Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/stiff-2.4.0/src/datamem.c Examining data/stiff-2.4.0/src/field.c Examining data/stiff-2.4.0/src/image.c Examining data/stiff-2.4.0/src/main.c Examining data/stiff-2.4.0/src/makeit.c Examining data/stiff-2.4.0/src/prefs.c Examining data/stiff-2.4.0/src/threads.c Examining data/stiff-2.4.0/src/tiff.c Examining data/stiff-2.4.0/src/datamem.h Examining data/stiff-2.4.0/src/define.h Examining data/stiff-2.4.0/src/field.h Examining data/stiff-2.4.0/src/globals.h Examining data/stiff-2.4.0/src/image.h Examining data/stiff-2.4.0/src/key.h Examining data/stiff-2.4.0/src/prefs.h Examining data/stiff-2.4.0/src/preflist.h Examining data/stiff-2.4.0/src/threads.h Examining data/stiff-2.4.0/src/tiff.h Examining data/stiff-2.4.0/src/types.h Examining data/stiff-2.4.0/src/xml.h Examining data/stiff-2.4.0/src/fits/fitsbody.c Examining data/stiff-2.4.0/src/fits/fitscat.c Examining data/stiff-2.4.0/src/fits/fitscheck.c Examining data/stiff-2.4.0/src/fits/fitscleanup.c Examining data/stiff-2.4.0/src/fits/fitsconv.c Examining data/stiff-2.4.0/src/fits/fitshead.c Examining data/stiff-2.4.0/src/fits/fitskey.c Examining data/stiff-2.4.0/src/fits/fitsmisc.c Examining data/stiff-2.4.0/src/fits/fitsread.c Examining data/stiff-2.4.0/src/fits/fitstab.c Examining data/stiff-2.4.0/src/fits/fitsutil.c Examining data/stiff-2.4.0/src/fits/fitswrite.c Examining data/stiff-2.4.0/src/fits/fitscat_defs.h Examining data/stiff-2.4.0/src/fits/fitscat.h Examining data/stiff-2.4.0/src/xml.c FINAL RESULTS: data/stiff-2.4.0/src/datamem.c:103:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(*swapname, "%s/vm%05ld_%05x.tmp", data/stiff-2.4.0/src/datamem.c:227:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(data_swapdirname, dirname); data/stiff-2.4.0/src/define.h:144:50: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define NPRINTF if (prefs.verbose_type == NORM) fprintf data/stiff-2.4.0/src/define.h:151:50: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define FPRINTF if (prefs.verbose_type == FULL) fprintf data/stiff-2.4.0/src/field.c:75:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(gstr,"Examining File %s", rfilename); data/stiff-2.4.0/src/field.c:160:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "[%s]", tab->extname); data/stiff-2.4.0/src/fits/fitsbody.c:113:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tab->swapname, "%s/vm%05ld_%05x.tmp", data/stiff-2.4.0/src/fits/fitsbody.c:213:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tab->swapname, "%s/vm%05ld_%05x.tmp", data/stiff-2.4.0/src/fits/fitsbody.c:1188:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(body_swapdirname, dirname); data/stiff-2.4.0/src/fits/fitscat.c:138:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str2, "%s %.65s", str2, str); data/stiff-2.4.0/src/fits/fitscat.h:129:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. char printf[80]; /* printing format (C Convention) */ data/stiff-2.4.0/src/fits/fitscat_defs.h:129:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(gstr, #ptr " (" #nel "=%lld elements) " \ data/stiff-2.4.0/src/fits/fitscat_defs.h:139:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(gstr, #ptr " (" #nel "=%lld elements) " \ data/stiff-2.4.0/src/fits/fitscat_defs.h:149:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(gstr, #ptr " (" #nel "=%lld elements) " \ data/stiff-2.4.0/src/fits/fitscat_defs.h:160:8: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(gstr, #ptrout " (" #nel "=%lld elements) " \ data/stiff-2.4.0/src/fits/fitscat_defs.h:172:29: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define QPRINTF if (qflag) fprintf data/stiff-2.4.0/src/fits/fitscleanup.c:99:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cleanup_filename[cleanup_nfiles++], filename); data/stiff-2.4.0/src/fits/fitsconv.c:106:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(key->comment, comment+strspn(comment, " ")); data/stiff-2.4.0/src/fits/fitsconv.c:123:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(comment, "%s keyword found twice in ", data/stiff-2.4.0/src/fits/fitshead.c:259:39: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fitsread(tab->headbuf, strk, key->printf, H_STRING, T_STRING); data/stiff-2.4.0/src/fits/fitshead.c:260:15: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if (*key->printf) data/stiff-2.4.0/src/fits/fitshead.c:261:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. tdisptoprintf(key->printf, key->printf); data/stiff-2.4.0/src/fits/fitshead.c:261:39: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. tdisptoprintf(key->printf, key->printf); data/stiff-2.4.0/src/fits/fitshead.c:428:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(str2, n?", %d%n":"%d%n", key->naxisn[n],&j); data/stiff-2.4.0/src/fits/fitshead.c:440:15: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if (*key->printf) data/stiff-2.4.0/src/fits/fitshead.c:444:56: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fitswrite(tab->headbuf, strk, printftotdisp(key->printf, str), data/stiff-2.4.0/src/fits/fitskey.c:197:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(key->name, keyname); data/stiff-2.4.0/src/fits/fitskey.c:529:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(names[i],key->name); data/stiff-2.4.0/src/fits/fitskey.c:684:15: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, skycathead, 6.0); data/stiff-2.4.0/src/fits/fitskey.c:698:8: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(key->name, map->newname); data/stiff-2.4.0/src/fits/fitskey.c:737:15: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(key->name, map->newname); data/stiff-2.4.0/src/fits/fitskey.c:825:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:825:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:825:54: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:845:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:845:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:845:54: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:866:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", data/stiff-2.4.0/src/fits/fitskey.c:866:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", data/stiff-2.4.0/src/fits/fitskey.c:866:54: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", data/stiff-2.4.0/src/fits/fitskey.c:869:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:869:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:869:54: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:889:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", data/stiff-2.4.0/src/fits/fitskey.c:889:43: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", data/stiff-2.4.0/src/fits/fitskey.c:889:55: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", data/stiff-2.4.0/src/fits/fitskey.c:909:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", data/stiff-2.4.0/src/fits/fitskey.c:909:42: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", data/stiff-2.4.0/src/fits/fitskey.c:909:54: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", data/stiff-2.4.0/src/fits/fitskey.c:940:22: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:940:44: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:940:56: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", data/stiff-2.4.0/src/fits/fitskey.c:986:6: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, skycattail, 1.0); data/stiff-2.4.0/src/fits/fitsread.c:60:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cat->filename, filename); data/stiff-2.4.0/src/fits/fitsread.c:98:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(ccat->filename, *filenames); data/stiff-2.4.0/src/fits/fitstab.c:446:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(tab->extname, tabname); data/stiff-2.4.0/src/fits/fitstab.c:709:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(names[i],tab->extname); data/stiff-2.4.0/src/fits/fitsutil.c:413:21: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). case H_COMMENT: strcpy(ptr,str+9); data/stiff-2.4.0/src/fits/fitsutil.c:416:22: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). case H_HCOMMENT: strcpy(ptr,str+33); data/stiff-2.4.0/src/fits/fitsutil.c:558:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "'%s'", str2); data/stiff-2.4.0/src/fits/fitsutil.c:564:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. case H_COMMENT: sprintf(str, "%-70s", (char *)ptr); data/stiff-2.4.0/src/fits/fitsutil.c:569:22: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. case H_HCOMMENT: sprintf(str, " / %-47s", (char *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:59:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cat->filename, filename); data/stiff-2.4.0/src/fits/fitswrite.c:418:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:418:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:418:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:423:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:423:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:423:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:428:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:428:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:428:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:433:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:433:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:433:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:438:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:438:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:438:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:451:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/fits/fitswrite.c:451:34: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/fits/fitswrite.c:451:46: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/fits/fitswrite.c:504:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:504:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:504:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:509:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:509:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:509:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:514:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:514:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:514:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:519:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:519:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:519:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:524:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:524:33: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:524:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, *key->printf?key->printf:"%lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitswrite.c:537:13: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/fits/fitswrite.c:537:34: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/fits/fitswrite.c:537:46: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stream, key->printf?key->printf:"%d", (int)*ptr); data/stiff-2.4.0/src/main.c:70:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(verstr, TIFFGetVersion()); data/stiff-2.4.0/src/main.c:105:15: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(prefs.prefs_name, argv[++a]); data/stiff-2.4.0/src/makeit.c:89:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(verstr, TIFFGetVersion()); data/stiff-2.4.0/src/makeit.c:221:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(error, "%s%s", msg1,msg2); data/stiff-2.4.0/src/prefs.c:102:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(keylist[i], key[i].name); data/stiff-2.4.0/src/prefs.c:119:11: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, *(dp++)+1); data/stiff-2.4.0/src/prefs.c:121:11: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, *(dp++)); data/stiff-2.4.0/src/prefs.c:134:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s %s", argkey[argi], argval[argi]); data/stiff-2.4.0/src/prefs.c:213:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy((char *)key[nkey].ptr, value); data/stiff-2.4.0/src/prefs.c:316:15: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(((char **)key[nkey].ptr)[i], value); data/stiff-2.4.0/src/tiff.c:108:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(image->filename, filename); data/stiff-2.4.0/src/tiff.c:223:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pssoft, "%s version %s (%s)\n", BANNER,MYVERSION,DATE); data/stiff-2.4.0/src/xml.c:503:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uunit, " unit=\"%s\"", unit); data/stiff-2.4.0/src/xml.c:509:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, *((double *)key[i].ptr)); data/stiff-2.4.0/src/xml.c:518:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, ((double *)key[i].ptr)[0]); data/stiff-2.4.0/src/xml.c:524:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, ((double *)key[i].ptr)[j]); data/stiff-2.4.0/src/xml.c:535:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, *((int *)key[i].ptr)); data/stiff-2.4.0/src/xml.c:544:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, ((int *)key[i].ptr)[0]); data/stiff-2.4.0/src/xml.c:550:11: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(value, format, ((int *)key[i].ptr)[j]); data/stiff-2.4.0/src/xml.c:587:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", (char *)key[i].ptr); data/stiff-2.4.0/src/xml.c:596:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", ((char **)key[i].ptr)[0]); data/stiff-2.4.0/src/xml.c:602:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", ((char **)key[i].ptr)[j]); data/stiff-2.4.0/src/xml.c:613:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", key[i].keylist[*((int *)key[i].ptr)]); data/stiff-2.4.0/src/xml.c:622:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[0]]); data/stiff-2.4.0/src/xml.c:628:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[j]]); data/stiff-2.4.0/src/prefs.c:169:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(envval=getenv(envname))) data/stiff-2.4.0/src/tiff.c:238:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(psuser = getenv("USERNAME"))) /* Cygwin,... */ data/stiff-2.4.0/src/tiff.c:239:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(psuser = getenv("LOGNAME"))) /* Linux,... */ data/stiff-2.4.0/src/tiff.c:240:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. psuser = getenv("USER"); data/stiff-2.4.0/src/tiff.c:241:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(pshost = getenv("HOSTNAME"))) data/stiff-2.4.0/src/tiff.c:242:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. pshost = getenv("HOST"); data/stiff-2.4.0/src/xml.c:230:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(psuser = getenv("USERNAME"))) /* Cygwin,... */ data/stiff-2.4.0/src/xml.c:231:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(psuser = getenv("LOGNAME"))) /* Linux,... */ data/stiff-2.4.0/src/xml.c:232:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. psuser = getenv("USER"); data/stiff-2.4.0/src/xml.c:233:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(pshost = getenv("HOSTNAME"))) data/stiff-2.4.0/src/xml.c:234:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. pshost = getenv("HOST"); data/stiff-2.4.0/src/xml.c:235:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. pspath = getenv("PWD"); data/stiff-2.4.0/src/datamem.c:54:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char data_swapdirname[MAXCHARS] = BODY_DEFSWAPDIR; data/stiff-2.4.0/src/datamem.c:106:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd=open(*swapname, O_RDWR|O_CREAT|O_TRUNC, 0666)) == -1) data/stiff-2.4.0/src/define.h:140:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptrout, ptrin, (size_t)(nel)*sizeof(typ));};;} data/stiff-2.4.0/src/field.c:84:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ext = atoi(str+1); data/stiff-2.4.0/src/field.c:115:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(field->ident, "no ident"); data/stiff-2.4.0/src/field.c:152:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char str[82]; data/stiff-2.4.0/src/field.c:166:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "[%d/%d]", t, field->cat->ntab-1); data/stiff-2.4.0/src/field.h:47:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[MAXCHAR]; /* Image filename */ data/stiff-2.4.0/src/field.h:49:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ident[MAXCHAR]; /* Field identifier (read from FITS) */ data/stiff-2.4.0/src/fits/fitsbody.c:52:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char body_swapdirname[MAXCHARS] = BODY_DEFSWAPDIR; data/stiff-2.4.0/src/fits/fitsbody.c:116:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(file=fopen(tab->swapname, "wb+"))) data/stiff-2.4.0/src/fits/fitsbody.c:216:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(file=fopen(tab->swapname, "wb+"))) data/stiff-2.4.0/src/fits/fitsbody.c:555:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&val16, bufdata, 2); data/stiff-2.4.0/src/fits/fitsbody.c:562:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dval,bufdata,4); data/stiff-2.4.0/src/fits/fitsbody.c:602:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&val16, bufdata, 2); data/stiff-2.4.0/src/fits/fitsbody.c:735:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&val16, bufdata, 2); data/stiff-2.4.0/src/fits/fitsbody.c:742:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dval,bufdata,4); data/stiff-2.4.0/src/fits/fitsbody.c:782:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&val16, bufdata, 2); data/stiff-2.4.0/src/fits/fitscat.c:118:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str2[82]; data/stiff-2.4.0/src/fits/fitscat.c:291:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tab->headbuf, bintabtemplate, sizeof(bintabtemplate)); data/stiff-2.4.0/src/fits/fitscat.c:408:22: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((cat->file = fopen(cat->filename, at==WRITE_ONLY?"wb":"rb")) == NULL) data/stiff-2.4.0/src/fits/fitscat.h:124:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[80]; /* name */ data/stiff-2.4.0/src/fits/fitscat.h:125:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char comment[80]; /* a comment */ data/stiff-2.4.0/src/fits/fitscat.h:129:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char printf[80]; /* printing format (C Convention) */ data/stiff-2.4.0/src/fits/fitscat.h:130:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char unit[80]; /* physical unit */ data/stiff-2.4.0/src/fits/fitscat.h:131:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char voucd[80]; /* VO ucd */ data/stiff-2.4.0/src/fits/fitscat.h:132:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vounit[80]; /* VO unit */ data/stiff-2.4.0/src/fits/fitscat.h:148:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[MAXCHARS]; /* file name */ data/stiff-2.4.0/src/fits/fitscat.h:178:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xtension[82]; /* FITS extension type */ data/stiff-2.4.0/src/fits/fitscat.h:179:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char extname[82]; /* FITS extension name */ data/stiff-2.4.0/src/fits/fitscat.h:192:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char swapname[MAXCHARS]; /* name of the swapfile */ data/stiff-2.4.0/src/fits/fitscat_defs.h:89:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gstr[MAXCHAR]; data/stiff-2.4.0/src/fits/fitscat_defs.h:165:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptrout, ptrin, (size_t)(nel)*sizeof(typ)); \ data/stiff-2.4.0/src/fits/fitscheck.c:105:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cbuf[16]; data/stiff-2.4.0/src/fits/fitscheck.c:227:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, (char *)tab->bodybuf+tab->tabsize-size, size); data/stiff-2.4.0/src/fits/fitscheck.c:269:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[32], data/stiff-2.4.0/src/fits/fitscheck.c:289:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%u", sum); data/stiff-2.4.0/src/fits/fitsconv.c:64:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char comment[82], keyword[16], ptr[82]; data/stiff-2.4.0/src/fits/fitsconv.c:94:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[81]; data/stiff-2.4.0/src/fits/fitshead.c:109:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[88]; data/stiff-2.4.0/src/fits/fitshead.c:110:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char key[12], name[16], data/stiff-2.4.0/src/fits/fitshead.c:115:46: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. filename = (tab->cat? tab->cat->filename : strcpy(name, "internal header")); data/stiff-2.4.0/src/fits/fitshead.c:136:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(key,"NAXIS%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:189:34: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). tab->bodysum = (unsigned int)atoi(str); data/stiff-2.4.0/src/fits/fitshead.c:210:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strf[88], strk[16]; data/stiff-2.4.0/src/fits/fitshead.c:248:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TTYPE%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:256:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TUNIT%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:258:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TDISP%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:263:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TFORM%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:293:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TDIM%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:340:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strk[88], str[88]; data/stiff-2.4.0/src/fits/fitshead.c:362:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "NAXIS%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:410:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TTYPE%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:413:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TFORM%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:421:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TDIM%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:436:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TUNIT%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:442:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(strk, "TDISP%-3d", i+1); data/stiff-2.4.0/src/fits/fitshead.c:457:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%u", tab->bodysum); data/stiff-2.4.0/src/fits/fitshead.c:662:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%d%c", n, t); data/stiff-2.4.0/src/fits/fitshead.c:747:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char control[4]; data/stiff-2.4.0/src/fits/fitshead.c:761:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dc",w); data/stiff-2.4.0/src/fits/fitshead.c:764:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dd",w); data/stiff-2.4.0/src/fits/fitshead.c:768:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%dd",w,d); data/stiff-2.4.0/src/fits/fitshead.c:770:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dd",w); data/stiff-2.4.0/src/fits/fitshead.c:774:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%dx",w,d); data/stiff-2.4.0/src/fits/fitshead.c:776:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dx",w); data/stiff-2.4.0/src/fits/fitshead.c:780:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%do",w,d); data/stiff-2.4.0/src/fits/fitshead.c:782:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%do",w); data/stiff-2.4.0/src/fits/fitshead.c:786:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%df",w,d); data/stiff-2.4.0/src/fits/fitshead.c:788:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%df",w); data/stiff-2.4.0/src/fits/fitshead.c:792:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%dE",w,d); data/stiff-2.4.0/src/fits/fitshead.c:794:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dE",w); data/stiff-2.4.0/src/fits/fitshead.c:798:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%d.%dG",w,d); data/stiff-2.4.0/src/fits/fitshead.c:800:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%%%dG",w); data/stiff-2.4.0/src/fits/fitshead.c:847:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "A%d",w); data/stiff-2.4.0/src/fits/fitshead.c:850:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "A%d",w); data/stiff-2.4.0/src/fits/fitshead.c:854:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "I%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:856:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "I%d",w); data/stiff-2.4.0/src/fits/fitshead.c:860:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "O%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:862:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "O%d",w); data/stiff-2.4.0/src/fits/fitshead.c:866:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "Z%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:868:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "Z%d",w); data/stiff-2.4.0/src/fits/fitshead.c:872:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "F%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:874:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "F%d",w); data/stiff-2.4.0/src/fits/fitshead.c:878:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "E%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:880:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "E%d",w); data/stiff-2.4.0/src/fits/fitshead.c:884:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "G%d.%d",w,d); data/stiff-2.4.0/src/fits/fitshead.c:886:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "G%d",w); data/stiff-2.4.0/src/fits/fitskey.c:606:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char oldname[80]; /* Name of the original pipeline key */ data/stiff-2.4.0/src/fits/fitskey.c:607:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newname[80]; /* Name of the skycat required key */ data/stiff-2.4.0/src/fits/fitskey.c:665:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). key_col[i] = atoi(++t); data/stiff-2.4.0/src/fits/fitskey.c:814:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. ptr = memcpy(rfield, buf+key->pos, key->nbytes); data/stiff-2.4.0/src/fits/fitsmisc.c:44:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char warning_historystr[WARNING_NMAX][192]={""}; data/stiff-2.4.0/src/fits/fitsmisc.c:89:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(warning_historystr[(nwarning++)%WARNING_NMAX], data/stiff-2.4.0/src/fits/fitsread.c:41:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char padbuf[FBSIZE]; data/stiff-2.4.0/src/fits/fitstab.c:445:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(tab->xtension, "BINTABLE"); data/stiff-2.4.0/src/fits/fitstab.c:457:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tab->headbuf, bintabtemplate, sizeof(bintabtemplate)); data/stiff-2.4.0/src/fits/fitsutil.c:61:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[82]; data/stiff-2.4.0/src/fits/fitsutil.c:79:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "NAXIS%-3d", i); data/stiff-2.4.0/src/fits/fitsutil.c:116:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%-8.8s %-71.71s", data/stiff-2.4.0/src/fits/fitsutil.c:119:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%-8.8s= / %-47.47s", data/stiff-2.4.0/src/fits/fitsutil.c:122:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%-8.8s= %-47.47s", data/stiff-2.4.0/src/fits/fitsutil.c:124:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(key_ptr, str, 80); data/stiff-2.4.0/src/fits/fitsutil.c:208:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(keyword, fitsline, 8); data/stiff-2.4.0/src/fits/fitsutil.c:282:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *((int *)ptr) = atoi(fitsline+j); data/stiff-2.4.0/src/fits/fitsutil.c:344:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[4], str[82]; data/stiff-2.4.0/src/fits/fitsutil.c:481:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[81],str2[81]; data/stiff-2.4.0/src/fits/fitsutil.c:494:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%20d", *(int *)ptr); data/stiff-2.4.0/src/fits/fitsutil.c:496:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%20d", *(short *)ptr); data/stiff-2.4.0/src/fits/fitsutil.c:499:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%20lld", *(SLONGLONG *)ptr); data/stiff-2.4.0/src/fits/fitsutil.c:503:19: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. case H_FLOAT: sprintf(str, " %16.8f", (ttype==T_DOUBLE)? data/stiff-2.4.0/src/fits/fitsutil.c:507:18: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. case H_EXPO: sprintf(str, " %19.12E", (ttype==T_DOUBLE)? data/stiff-2.4.0/src/fits/fitsutil.c:513:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, " T"); data/stiff-2.4.0/src/fits/fitsutil.c:515:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, " F"); data/stiff-2.4.0/src/fits/fitsutil.c:531:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "'%-18.18s ", str2); data/stiff-2.4.0/src/fits/fitsutil.c:537:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "'%-68.68s ", str2); data/stiff-2.4.0/src/fits/fitswrite.c:256:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char padbuf[FBSIZE]; data/stiff-2.4.0/src/globals.h:32:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gstr[MAXCHAR]; data/stiff-2.4.0/src/image.c:311:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(image->buf, extrapix, width*ntlines*image->bypp*nchan); data/stiff-2.4.0/src/image.c:399:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *swapname[3], data/stiff-2.4.0/src/image.c:954:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(outpixt, inpixt, tilesizex); data/stiff-2.4.0/src/image.h:56:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[MAXCHAR]; /* Output filename */ data/stiff-2.4.0/src/key.h:39:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[32]; data/stiff-2.4.0/src/key.h:45:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char keylist[32][32]; /* List of keywords */ data/stiff-2.4.0/src/main.c:58:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char verstr[MAXCHAR], data/stiff-2.4.0/src/main.c:85:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(prefs.prefs_name, "stiff.conf"); data/stiff-2.4.0/src/makeit.c:63:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char verstr[MAXCHAR], imtype[MAXCHAR], data/stiff-2.4.0/src/makeit.c:74:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.sdate_start,"%04d-%02d-%02d", data/stiff-2.4.0/src/makeit.c:76:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.stime_start,"%02d:%02d:%02d", data/stiff-2.4.0/src/makeit.c:150:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(imtype,"integers"); data/stiff-2.4.0/src/makeit.c:152:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(imtype,"floats"); data/stiff-2.4.0/src/makeit.c:185:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.sdate_end,"%04d-%02d-%02d", data/stiff-2.4.0/src/makeit.c:187:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.stime_end,"%02d:%02d:%02d", data/stiff-2.4.0/src/makeit.c:219:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char error[MAXCHAR]; data/stiff-2.4.0/src/preflist.h:113:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char keylist[sizeof(key)/sizeof(pkeystruct)][32]; data/stiff-2.4.0/src/prefs.c:82:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *cp, str[MAXCHAR], *keyword, *value, **dp; data/stiff-2.4.0/src/prefs.c:86:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char value2[MAXCHAR],envname[MAXCHAR]; data/stiff-2.4.0/src/prefs.c:91:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((infile = fopen(filename,"r")) == NULL) data/stiff-2.4.0/src/prefs.c:203:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ival = atoi(value); data/stiff-2.4.0/src/prefs.c:213:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. strcpy((char *)key[nkey].ptr, value); data/stiff-2.4.0/src/prefs.c:314:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. free(((char **)key[nkey].ptr)[i]); data/stiff-2.4.0/src/prefs.c:315:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. QMALLOC(((char **)key[nkey].ptr)[i], char, MAXCHAR); data/stiff-2.4.0/src/prefs.c:316:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. strcpy(((char **)key[nkey].ptr)[i], value); data/stiff-2.4.0/src/prefs.h:38:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char prefs_name[MAXCHAR]; /* prefs filename */ data/stiff-2.4.0/src/prefs.h:39:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *(file_name[MAXFILE]); /* Filename(s) of input images */ data/stiff-2.4.0/src/prefs.h:42:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char copyright[MAXCHAR]; /* Copyright notice */ data/stiff-2.4.0/src/prefs.h:43:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char description[MAXCHAR]; /* Image description */ data/stiff-2.4.0/src/prefs.h:49:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tiff_name[MAXCHAR]; /* Output filename */ data/stiff-2.4.0/src/prefs.h:89:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char swapdir_name[MAXCHAR]; /* Name of virtual mem directory */ data/stiff-2.4.0/src/prefs.h:99:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xml_name[MAXCHAR]; /* XML file name */ data/stiff-2.4.0/src/prefs.h:100:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xsl_name[MAXCHAR]; /* XSL file name (or URL) */ data/stiff-2.4.0/src/prefs.h:102:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sdate_start[12]; /* STIFF start date */ data/stiff-2.4.0/src/prefs.h:103:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char stime_start[12]; /* STIFF start time */ data/stiff-2.4.0/src/prefs.h:104:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sdate_end[12]; /* STIFF end date */ data/stiff-2.4.0/src/prefs.h:105:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char stime_end[12]; /* STIFF end time */ data/stiff-2.4.0/src/tiff.c:78:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char flagstr[8]; data/stiff-2.4.0/src/tiff.c:85:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(flagstr, "w8"); data/stiff-2.4.0/src/tiff.c:91:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(flagstr, "w8"); data/stiff-2.4.0/src/tiff.c:151:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char datetimeb[32], data/stiff-2.4.0/src/tiff.c:230:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(datetimeb,"%04d:%02d:%02d %02d:%02d:%02d", data/stiff-2.4.0/src/xml.c:136:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). else if (!(file = fopen(prefs.xml_name, "w"))) data/stiff-2.4.0/src/xml.c:163:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sysname[16], data/stiff-2.4.0/src/xml.c:187:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(sysname, "ICRS"); data/stiff-2.4.0/src/xml.c:209:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char psuserb[MAXCHAR], data/stiff-2.4.0/src/xml.c:220:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.sdate_end,"%04d-%02d-%02d", data/stiff-2.4.0/src/xml.c:222:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(prefs.stime_end,"%02d:%02d:%02d", data/stiff-2.4.0/src/xml.c:462:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). else if (!(file = fopen(filename, "w"))) data/stiff-2.4.0/src/xml.c:495:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char value[MAXCHAR], uunit[MAXCHAR]; data/stiff-2.4.0/src/xml.c:561:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(value, "%c", *((int *)key[i].ptr)? 'T':'F'); data/stiff-2.4.0/src/xml.c:570:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(value, "%c", ((int *)key[i].ptr)[0]? 'T':'F'); data/stiff-2.4.0/src/xml.c:576:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(value, "%c", ((int *)key[i].ptr)[j]? 'T':'F'); data/stiff-2.4.0/src/xml.c:587:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. sprintf(value, "%s", (char *)key[i].ptr); data/stiff-2.4.0/src/xml.c:596:32: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. sprintf(value, "%s", ((char **)key[i].ptr)[0]); data/stiff-2.4.0/src/xml.c:602:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. sprintf(value, "%s", ((char **)key[i].ptr)[j]); data/stiff-2.4.0/src/fits/fitsconv.c:96:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(line, lptr, 80); data/stiff-2.4.0/src/fits/fitshead.c:423:7: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(str, "("); data/stiff-2.4.0/src/fits/fitshead.c:431:7: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(str2, ")"); data/stiff-2.4.0/src/fits/fitshead.c:492:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(tab->headbuf, "SIMPLE = T " data/stiff-2.4.0/src/fits/fitshead.c:523:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(tab->headbuf, "XTENSION= 'IMAGE ' " data/stiff-2.4.0/src/fits/fitsutil.c:148:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(keyword); data/stiff-2.4.0/src/fits/fitsutil.c:175:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(fitsbuf, str, strlen(str))) data/stiff-2.4.0/src/fits/fitsutil.c:350:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(str,fitsbuf+80*pos,80); data/stiff-2.4.0/src/fits/fitsutil.c:373:18: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. case H_BOOL: sscanf(str+10, "%1s", s); data/stiff-2.4.0/src/fits/fitsutil.c:529:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(str2)<=18) data/stiff-2.4.0/src/fits/fitsutil.c:590:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (posoff==10 && i && (l=69-strlen(str))>0) data/stiff-2.4.0/src/fits/fitsutil.c:592:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(str2, cstr, i); data/stiff-2.4.0/src/fits/fitsutil.c:594:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(str, " "); data/stiff-2.4.0/src/fits/fitsutil.c:595:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(str, str2, l); data/stiff-2.4.0/src/main.c:93:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(argv[a])<4 || opt == '-') data/stiff-2.4.0/src/prefs.c:165:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(envname, valuet, nc=strcspn(valuet,"}/:\"\'\\")); data/stiff-2.4.0/src/tiff.c:81:3: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(flagstr, "w"); ANALYSIS SUMMARY: Hits = 327 Lines analyzed = 12235 in approximately 0.39 seconds (31292 lines/second) Physical Source Lines of Code (SLOC) = 7862 Hits@level = [0] 186 [1] 17 [2] 174 [3] 12 [4] 124 [5] 0 Hits@level+ = [0+] 513 [1+] 327 [2+] 310 [3+] 136 [4+] 124 [5+] 0 Hits/KSLOC@level+ = [0+] 65.2506 [1+] 41.5925 [2+] 39.4302 [3+] 17.2984 [4+] 15.7721 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.