mirror of https://github.com/XEphem/XEphem.git
fix(libastro): prevent buffer overflow reading external files
This commit is contained in:
parent
cc1ef1bfb4
commit
ca4c9e8f9f
|
|
@ -1673,7 +1673,7 @@ cns_loadfigs (FILE *fp, char *msg)
|
|||
continue;
|
||||
|
||||
/* ok, line looks interesting, look more carefully */
|
||||
if (sscanf (lp, "%d %s %s", &code, rastr, decstr) == 3) {
|
||||
if (sscanf (lp, "%d %63s %63s", &code, rastr, decstr) == 3) {
|
||||
/* looks like a drawing line */
|
||||
double ra, dec;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ GEOMAG:
|
|||
c[0][0] = 0.0;
|
||||
cd[0][0] = 0.0;
|
||||
fgets(c_str, 80, wmmdat);
|
||||
sscanf(c_str,"%f%s",&epoc,model);
|
||||
sscanf(c_str,"%f%19s",&epoc,model);
|
||||
S3:
|
||||
fgets(c_str, 80, wmmdat);
|
||||
/* CHECK FOR LAST LINE IN FILE */
|
||||
|
|
|
|||
Loading…
Reference in New Issue