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/mgp-1.13a+upstream20090219/background.c
Examining data/mgp-1.13a+upstream20090219/font.c
Examining data/mgp-1.13a+upstream20090219/globals.c
Examining data/mgp-1.13a+upstream20090219/m17n.c
Examining data/mgp-1.13a+upstream20090219/mng.c
Examining data/mgp-1.13a+upstream20090219/postscript.c
Examining data/mgp-1.13a+upstream20090219/tfont.c
Examining data/mgp-1.13a+upstream20090219/unimap.c
Examining data/mgp-1.13a+upstream20090219/x11dummy.c
Examining data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c
Examining data/mgp-1.13a+upstream20090219/contrib/xmindpath/pathnames.h
Examining data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/dsimple.h
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/list.h
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/multiVis.h
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/wsutils.h
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/dsimple.c
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/list.c
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/multiVis.c
Examining data/mgp-1.13a+upstream20090219/contrib/xwintoppm/xwintoppm.c
Examining data/mgp-1.13a+upstream20090219/image/clip.c
Examining data/mgp-1.13a+upstream20090219/image/cmuwmraster.c
Examining data/mgp-1.13a+upstream20090219/image/cmuwmraster.h
Examining data/mgp-1.13a+upstream20090219/image/copyright.h
Examining data/mgp-1.13a+upstream20090219/image/dither.c
Examining data/mgp-1.13a+upstream20090219/image/faces.c
Examining data/mgp-1.13a+upstream20090219/image/fbm.c
Examining data/mgp-1.13a+upstream20090219/image/fbm.h
Examining data/mgp-1.13a+upstream20090219/image/g3.c
Examining data/mgp-1.13a+upstream20090219/image/g3.h
Examining data/mgp-1.13a+upstream20090219/image/gif.c
Examining data/mgp-1.13a+upstream20090219/image/halftone.c
Examining data/mgp-1.13a+upstream20090219/image/image.h
Examining data/mgp-1.13a+upstream20090219/image/imagetypes.c
Examining data/mgp-1.13a+upstream20090219/image/imagetypes.h
Examining data/mgp-1.13a+upstream20090219/image/img.c
Examining data/mgp-1.13a+upstream20090219/image/img.h
Examining data/mgp-1.13a+upstream20090219/image/imlib_loader.c
Examining data/mgp-1.13a+upstream20090219/image/jpeg.c
Examining data/mgp-1.13a+upstream20090219/image/jpeg.h
Examining data/mgp-1.13a+upstream20090219/image/mac.c
Examining data/mgp-1.13a+upstream20090219/image/kljcpyrght.h
Examining data/mgp-1.13a+upstream20090219/image/mac.h
Examining data/mgp-1.13a+upstream20090219/image/mc_tables.c
Examining data/mgp-1.13a+upstream20090219/image/mcidas.c
Examining data/mgp-1.13a+upstream20090219/image/mcidas.h
Examining data/mgp-1.13a+upstream20090219/image/misc.c
Examining data/mgp-1.13a+upstream20090219/image/new.c
Examining data/mgp-1.13a+upstream20090219/image/options.h
Examining data/mgp-1.13a+upstream20090219/image/pbm.c
Examining data/mgp-1.13a+upstream20090219/image/pbm.h
Examining data/mgp-1.13a+upstream20090219/image/pcx.c
Examining data/mgp-1.13a+upstream20090219/image/pcx.h
Examining data/mgp-1.13a+upstream20090219/image/png.c
Examining data/mgp-1.13a+upstream20090219/image/reduce.c
Examining data/mgp-1.13a+upstream20090219/image/rle.c
Examining data/mgp-1.13a+upstream20090219/image/rle.h
Examining data/mgp-1.13a+upstream20090219/image/send.c
Examining data/mgp-1.13a+upstream20090219/image/sunraster.c
Examining data/mgp-1.13a+upstream20090219/image/sunraster.h
Examining data/mgp-1.13a+upstream20090219/image/tgncpyrght.h
Examining data/mgp-1.13a+upstream20090219/image/value.c
Examining data/mgp-1.13a+upstream20090219/image/xwd.c
Examining data/mgp-1.13a+upstream20090219/image/xbitmap.c
Examining data/mgp-1.13a+upstream20090219/image/xloadimage.h
Examining data/mgp-1.13a+upstream20090219/image/xpixmap.c
Examining data/mgp-1.13a+upstream20090219/image/xwd.h
Examining data/mgp-1.13a+upstream20090219/image/zio.c
Examining data/mgp-1.13a+upstream20090219/image/bright.c
Examining data/mgp-1.13a+upstream20090219/image/path.c
Examining data/mgp-1.13a+upstream20090219/image/rlelib.c
Examining data/mgp-1.13a+upstream20090219/image/rotate.c
Examining data/mgp-1.13a+upstream20090219/image/smooth.c
Examining data/mgp-1.13a+upstream20090219/image/window.c
Examining data/mgp-1.13a+upstream20090219/image/zoom.c
Examining data/mgp-1.13a+upstream20090219/image/compress.c
Examining data/mgp-1.13a+upstream20090219/missing/memcmp.c
Examining data/mgp-1.13a+upstream20090219/missing/mkstemp.c
Examining data/mgp-1.13a+upstream20090219/missing/snprintf.c
Examining data/mgp-1.13a+upstream20090219/missing/strdup.c
Examining data/mgp-1.13a+upstream20090219/missing/strlcat.c
Examining data/mgp-1.13a+upstream20090219/missing/strlcpy.c
Examining data/mgp-1.13a+upstream20090219/missing/strsep.c
Examining data/mgp-1.13a+upstream20090219/missing/usleep.c
Examining data/mgp-1.13a+upstream20090219/ctlwords.c
Examining data/mgp-1.13a+upstream20090219/mgp.h
Examining data/mgp-1.13a+upstream20090219/embed.c
Examining data/mgp-1.13a+upstream20090219/print.c
Examining data/mgp-1.13a+upstream20090219/x11.c
Examining data/mgp-1.13a+upstream20090219/plist.c
Examining data/mgp-1.13a+upstream20090219/draw.c
Examining data/mgp-1.13a+upstream20090219/mgp.c
Examining data/mgp-1.13a+upstream20090219/parse.c

FINAL RESULTS:

data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:56:33:  [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 dprintf(x)	{ if (debug) fprintf x; }
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:58:35:  [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 verbmsg(x)	{ if (verbose) fprintf x; }
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:130:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(p, "/dev/%s", remote);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:58:8:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	(void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:107:8:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	(void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname);
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/dsimple.c:507:2:  [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(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/dsimple.c:525:2:  [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(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/xwintoppm.c:161:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
	(void) sscanf (s, fmt, &retval);
data/mgp-1.13a+upstream20090219/draw.c:935: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(mgp_charset, cp->ctc_value);
data/mgp-1.13a+upstream20090219/draw.c:2538:4:  [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(buf, seed);
data/mgp-1.13a+upstream20090219/draw.c:2541:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(tmp, "%s-*-*", seed);
data/mgp-1.13a+upstream20090219/draw.c:2542:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(buf, FONT_FORMAT, tmp, tmp2, registry);
data/mgp-1.13a+upstream20090219/draw.c:2545:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(buf, FONT_FORMAT, seed, tmp2, registry);
data/mgp-1.13a+upstream20090219/draw.c:2549: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(buf, seed);
data/mgp-1.13a+upstream20090219/draw.c:3818:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execvp(argv[0], argv);
data/mgp-1.13a+upstream20090219/draw.c:3944:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execvp(argv[0], argv);
data/mgp-1.13a+upstream20090219/draw.c:4130:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execvp(argv[0], argv);
data/mgp-1.13a+upstream20090219/draw.c:4341:2:  [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(imagefile, epsfile);
data/mgp-1.13a+upstream20090219/draw.c:4346:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(cp, ".gscache.%s.%dx%d", epsfile + (cp - imagefile),
data/mgp-1.13a+upstream20090219/draw.c:4381:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(device, "-sDEVICE=%s", gsdevice);
data/mgp-1.13a+upstream20090219/draw.c:4417: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(imagefile, cp);
data/mgp-1.13a+upstream20090219/draw.c:4437:4:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
			execlp("pnmdepth", "pnmdepth", "255", NULL);
data/mgp-1.13a+upstream20090219/draw.c:4460:4:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
			execlp("pnmscale", "pnmscale", scalebuf, NULL);
data/mgp-1.13a+upstream20090219/draw.c:4483:3:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execlp("gs", "gs", geom, device, "-sOutputFile=-", "-q", "-", NULL);
data/mgp-1.13a+upstream20090219/draw.c:4702:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(tmp1, "%s-*", seed);
data/mgp-1.13a+upstream20090219/draw.c:4724:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(tmp2, "%s-*", registry);
data/mgp-1.13a+upstream20090219/draw.c:5272:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf16, "%s%s%c", prefix[i], p, 0);
data/mgp-1.13a+upstream20090219/embed.c:91:12:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	if ((pp = popen(UUDECODE_ALL, "w")) == NULL) {
data/mgp-1.13a+upstream20090219/embed.c:96:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(bf, F_OK) == 0) {
data/mgp-1.13a+upstream20090219/embed.c:114:3:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		system(bf);
data/mgp-1.13a+upstream20090219/image/bright.c:187:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(newimage->title, "%s (normalized)", image->title);
data/mgp-1.13a+upstream20090219/image/dither.c:76:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(image->title, "%s (dithered)", cimage->title);
data/mgp-1.13a+upstream20090219/image/faces.c:141:3:  [4] (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).
  strcat(fname, lname);
data/mgp-1.13a+upstream20090219/image/halftone.c:181:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(image->title, "%s (halftoned)", cimage->title);
data/mgp-1.13a+upstream20090219/image/imlib_loader.c:129:2:  [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(imfile[imnum], fullname);	
data/mgp-1.13a+upstream20090219/image/jpeg.c:49: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.
# define debug(xx)	fprintf(stderr,xx)
data/mgp-1.13a+upstream20090219/image/jpeg.c:3700:3:  [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(stderr, msgtext,
data/mgp-1.13a+upstream20090219/image/new.c:80: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(d, s);
data/mgp-1.13a+upstream20090219/image/path.c:56:10:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
  while (fscanf(f, "%s", tokenbuf) > 0) {
data/mgp-1.13a+upstream20090219/image/path.c:74:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
      if (sscanf(tokenbuf + strlen(PathToken), "%s", buf) != 1)
data/mgp-1.13a+upstream20090219/image/path.c:79:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
      if (sscanf(tokenbuf + strlen(ExtToken), "%s", buf) != 1)
data/mgp-1.13a+upstream20090219/image/path.c:83: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(buf, tokenbuf);
data/mgp-1.13a+upstream20090219/image/path.c:131:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(buf, "%s/.xloadimagerc", pw->pw_dir);
data/mgp-1.13a+upstream20090219/image/path.c:133:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  if (! access(buf, R_OK)) {
data/mgp-1.13a+upstream20090219/image/path.c:148:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  return(access(fullname, R_OK)); /* we can read it */
data/mgp-1.13a+upstream20090219/image/path.c:160: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(fullname, name);
data/mgp-1.13a+upstream20090219/image/path.c:175:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fullname, "%s/%s", Paths[p], name);
data/mgp-1.13a+upstream20090219/image/path.c:184:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(fullname, "%s/%s%s", Paths[p], name, Exts[e]);
data/mgp-1.13a+upstream20090219/image/path.c:196:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fullname, "%s%s", name, Exts[e]);
data/mgp-1.13a+upstream20090219/image/path.c:223:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "ls %s", Paths[a]);
data/mgp-1.13a+upstream20090219/image/path.c:224:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system(buf) < 0) {
data/mgp-1.13a+upstream20090219/image/path.c:272:7:  [4] (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).
      strcat(buf1, getenv("HOME"));
data/mgp-1.13a+upstream20090219/image/path.c:280:2:  [4] (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).
	strcat(buf1, getenv(buf2));
data/mgp-1.13a+upstream20090219/image/path.c:308: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(ptr, buf1);
data/mgp-1.13a+upstream20090219/image/reduce.c:506:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "%s (%d colors)", image->title, n);
data/mgp-1.13a+upstream20090219/image/rle.c:14: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.
# define debug(xx)	fprintf(stderr,xx)
data/mgp-1.13a+upstream20090219/image/rotate.c:74:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees);
data/mgp-1.13a+upstream20090219/image/smooth.c:31:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(new->title, "%s (smoothed)", image->title);
data/mgp-1.13a+upstream20090219/image/xbitmap.c:163:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (sscanf(line,"#define %s %d", name_and_type, &value) == 2) {
data/mgp-1.13a+upstream20090219/image/xbitmap.c:178:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (sscanf(line, "static short %s = {", name_and_type) == 1) {
data/mgp-1.13a+upstream20090219/image/xbitmap.c:182:10:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if ((sscanf(line,"static unsigned char %s = {", name_and_type) == 1) ||
data/mgp-1.13a+upstream20090219/image/xbitmap.c:183:3:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	(sscanf(line, "static char %s = {", name_and_type) == 1)) {
data/mgp-1.13a+upstream20090219/image/xpixmap.c:78:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
      if (sscanf(buf, "#define %s %d", what, &value) != 2) {
data/mgp-1.13a+upstream20090219/image/xpixmap.c:112:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    else if ((sscanf(buf, "static char * %s", what) == 1) &&
data/mgp-1.13a+upstream20090219/image/xpixmap.c:196:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (sscanf(buf, "static char * %s", what) == 1)
data/mgp-1.13a+upstream20090219/image/zio.c:208:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "uncompress -c %s", name);
data/mgp-1.13a+upstream20090219/image/zio.c:209:24:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (! (zf->stream= popen(buf, "r"))) {
data/mgp-1.13a+upstream20090219/image/zoom.c:65:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(buf, "%s (Y zoom %0.2f%%)", oimage->title, yzoom);
data/mgp-1.13a+upstream20090219/image/zoom.c:71:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(buf, "%s (X zoom %0.2f%%)", oimage->title, xzoom);
data/mgp-1.13a+upstream20090219/image/zoom.c:77:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(buf, "%s (%f%% zoom)", oimage->title, xzoom);
data/mgp-1.13a+upstream20090219/image/zoom.c:84:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(buf, "%s (X zoom %0.2f%% Y zoom %0.2f%%)", oimage->title,
data/mgp-1.13a+upstream20090219/m17n.c:260: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 (copy, seed);
data/mgp-1.13a+upstream20090219/mgp.c:531:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s/%ld", dumpdir, (long)time((time_t *)NULL));
data/mgp-1.13a+upstream20090219/mgp.c:557:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "xwintoppm -silent -name MagicPoint | "
data/mgp-1.13a+upstream20090219/mgp.c:560:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		if (system(buf) < 0){	/*XXX security hole*/
data/mgp-1.13a+upstream20090219/mgp.c:565:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s %s/mgp%05d.%s | "
data/mgp-1.13a+upstream20090219/mgp.c:569:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		if (system(buf) < 0){	/*XXX security hole*/
data/mgp-1.13a+upstream20090219/mgp.c:578:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s/mgp%05d.html", dumpdir, page);
data/mgp-1.13a+upstream20090219/mgp.c:624:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, "%s/mgp%05d.txt", dumpdir, page);
data/mgp-1.13a+upstream20090219/mgp.c:664:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s/index.html", dumpdir);
data/mgp-1.13a+upstream20090219/missing/snprintf.c:39:1:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
vsnprintf(char *string, int n, const char *fmt, va_list ap)
data/mgp-1.13a+upstream20090219/missing/snprintf.c:70:1:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
snprintf(char *string, int n, const char *fmt, ...)
data/mgp-1.13a+upstream20090219/missing/snprintf.c:76:8:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	ret = vsnprintf(string, n, fmt, ap);
data/mgp-1.13a+upstream20090219/missing/strdup.c:44: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(p, str);
data/mgp-1.13a+upstream20090219/parse.c:244:2:  [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(s, p);
data/mgp-1.13a+upstream20090219/parse.c:709:6:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
					execvp(filtermode->cta_argv[0],
data/mgp-1.13a+upstream20090219/parse.c:1622:3:  [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(stderr, ((p->cti_value == VL_CENTER) ? "center"
data/mgp-1.13a+upstream20090219/parse.c:1912: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(buf, p);
data/mgp-1.13a+upstream20090219/parse.c:1916:3:  [4] (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).
		strcat(buf, fname);
data/mgp-1.13a+upstream20090219/plist.c:154:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "page %d: %s", page, page_title(page));
data/mgp-1.13a+upstream20090219/print.c:1606:2:  [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(epsfile, fname);
data/mgp-1.13a+upstream20090219/print.c:2380:4:  [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(outputfile, optarg);
data/mgp-1.13a+upstream20090219/tfont.c:342:2:  [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(tfloadedfont[tffontcnt], fontname);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:96:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((ch = getopt(argc, argv, "df:v")) != EOF) {
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:118:25:  [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.
	display = XOpenDisplay(getenv("DISPLAY"));
data/mgp-1.13a+upstream20090219/draw.c:4411:13:  [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 ((cp = getenv("TMPDIR")) == NULL)
data/mgp-1.13a+upstream20090219/image/path.c:259:9:  [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.
  char *getenv();
data/mgp-1.13a+upstream20090219/image/path.c:272: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.
      strcat(buf1, getenv("HOME"));
data/mgp-1.13a+upstream20090219/image/path.c:280:15:  [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.
	strcat(buf1, getenv(buf2));
data/mgp-1.13a+upstream20090219/mgp.c:229:11:  [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 ((p = getenv("MGPWDIR")) != NULL) {
data/mgp-1.13a+upstream20090219/mgp.c:265:16:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((opt = getopt(argc, argv, ACCEPTOPTS)) != -1) {
data/mgp-1.13a+upstream20090219/parse.c:76: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.
	if((dir = getenv("MGPRC"))!=0) {
data/mgp-1.13a+upstream20090219/parse.c:84:13:  [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.
      dir = getenv("HOME");
data/mgp-1.13a+upstream20090219/print.c:2366:16:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((opt = getopt(argc, argv, "mciVrf:x:y:p:e:X:Ptg:")) != -1) {
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:139:7:  [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).
	fd = open(remote, O_NONBLOCK);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:156:7:  [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).
	fd = open(remote, O_RDONLY);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:55:2:  [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 tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:59:7:  [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).
	fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0664);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:65:8:  [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).
		fd = open(tbuf, O_RDWR, 0);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:105:2:  [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 tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/xwintoppm.c:196:23:  [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 (!(out_file = fopen(argv[i], "wb")))
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/xwintoppm.c:559:14:  [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.
    unsigned char buf[3];
data/mgp-1.13a+upstream20090219/ctlwords.c:33:2:  [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 buf[1024];
data/mgp-1.13a+upstream20090219/draw.c:1510: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(&backup0, state, sizeof(struct render_state));
data/mgp-1.13a+upstream20090219/draw.c:1575: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(&backup, state, sizeof(struct render_state));
data/mgp-1.13a+upstream20090219/draw.c:1899:9:  [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 hist[256];
data/mgp-1.13a+upstream20090219/draw.c:2156:2:  [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 ch[2];
data/mgp-1.13a+upstream20090219/draw.c:2515:2:  [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 tmp[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:2516:2:  [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 tmp2[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:2526: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(tmp2, "%d", siz);
data/mgp-1.13a+upstream20090219/draw.c:2586:10:  [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).
	fsize = atoi(p);
data/mgp-1.13a+upstream20090219/draw.c:2624:2:  [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 fontstring[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:2951:2:  [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(&cg1, cg0, sizeof(struct ctrl_grad));
data/mgp-1.13a+upstream20090219/draw.c:3212:9:  [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 backfile[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/draw.c:3408:2:  [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 fullname[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/draw.c:3711:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:3767: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(argv, cp->cta_argv, (cp->cta_argc + 1) * sizeof(char *));
data/mgp-1.13a+upstream20090219/draw.c:3777:4:  [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(q, "%dx%d", xsiz * state->width / 100,
data/mgp-1.13a+upstream20090219/draw.c:3792:4:  [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(q, "+%d+%d", xloc + state->xoff, yloc + state->yoff);
data/mgp-1.13a+upstream20090219/draw.c:3839:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:3879: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(argv, cp->cta_argv, (cp->cta_argc + 1) * sizeof(char *));
data/mgp-1.13a+upstream20090219/draw.c:3891:4:  [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(q, "%dx%d", xsiz, ysiz);
data/mgp-1.13a+upstream20090219/draw.c:3895: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(q, "+%d+%d", DisplayWidth(display, DefaultScreen(display)),
data/mgp-1.13a+upstream20090219/draw.c:3917: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 geom_arg2[512];
data/mgp-1.13a+upstream20090219/draw.c:3919: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(geom_arg2, "+%d+%d", DisplayWidth(display, 
data/mgp-1.13a+upstream20090219/draw.c:4007:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:4009:2:  [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 title_arg2[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:4034:2:  [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(argv, cp->cta_argv, (argc + 1) * sizeof(char *));
data/mgp-1.13a+upstream20090219/draw.c:4063:4:  [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(q, "%dx%d", xsiz, ysiz);
data/mgp-1.13a+upstream20090219/draw.c:4068: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(q, "+%d+%d", DisplayWidth(display, DefaultScreen(display)),
data/mgp-1.13a+upstream20090219/draw.c:4093: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 geom_arg2[512];
data/mgp-1.13a+upstream20090219/draw.c:4095: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(geom_arg2, "+%d+%d", DisplayWidth(display, 
data/mgp-1.13a+upstream20090219/draw.c:4125:8:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
	pid = vfork();
data/mgp-1.13a+upstream20090219/draw.c:4332:2:  [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 geom[32], device[64], scalebuf[32];
data/mgp-1.13a+upstream20090219/draw.c:4333:9:  [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 imagefile[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/draw.c:4389:11:  [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).
		scale = atoi(cp);
data/mgp-1.13a+upstream20090219/draw.c:4404: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(scalebuf, "%f", 1. / (double)scale);
data/mgp-1.13a+upstream20090219/draw.c:4405:2:  [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(geom, "-g%dx%d", width, height);
data/mgp-1.13a+upstream20090219/draw.c:4408:7:  [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).
	fd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC, 0600);
data/mgp-1.13a+upstream20090219/draw.c:4418:3:  [2] (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 string.
		strcat(imagefile, "/mgp.XXXXXXXX");
data/mgp-1.13a+upstream20090219/draw.c:4419:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
		if ((fd = mkstemp(imagefile)) < 0) {
data/mgp-1.13a+upstream20090219/draw.c:4429:14:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
		if ((pid = vfork()) == 0) {
data/mgp-1.13a+upstream20090219/draw.c:4452:16:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
		if ((gspid = vfork()) == 0) {
data/mgp-1.13a+upstream20090219/draw.c:4476:15:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
	if ((gspid = vfork()) == 0) {
data/mgp-1.13a+upstream20090219/draw.c:4671:2:  [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 tmp1[BUFSIZ], tmp2[BUFSIZ];
data/mgp-1.13a+upstream20090219/draw.c:4823:2:  [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(state, &cache_state, sizeof(struct render_state));	
data/mgp-1.13a+upstream20090219/draw.c:5125:11:  [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).
			return atoi(p) -1;
data/mgp-1.13a+upstream20090219/draw.c:5242:9:  [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 etab[3][20] = { "iso-2022-jp", "gb2312", "ksc5601"};
data/mgp-1.13a+upstream20090219/draw.c:5243:9:  [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 rtab[3][20] = { "jisx208", "gb2312", "ksc5601"};
data/mgp-1.13a+upstream20090219/draw.c:5244:9:  [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 prefix[3][20] = { "\033$B", "\033$A", "\033$(C"};
data/mgp-1.13a+upstream20090219/draw.c:5245:2:  [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 buf16[1024], *p16;
data/mgp-1.13a+upstream20090219/draw.c:5246:2:  [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 out16[1024], *o16;
data/mgp-1.13a+upstream20090219/draw.c:5369:2:  [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 buf[65535], *p1;  
data/mgp-1.13a+upstream20090219/draw.c:5374: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(buf, p, len);
data/mgp-1.13a+upstream20090219/draw.c:5423:9:  [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 lastfont[200];
data/mgp-1.13a+upstream20090219/draw.c:5427:2:  [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 style[100];
data/mgp-1.13a+upstream20090219/draw.c:5428:2:  [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 font[100];
data/mgp-1.13a+upstream20090219/embed.c:36: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 mgpwdirname[BUFSIZ] = "";
data/mgp-1.13a+upstream20090219/embed.c:76:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/globals.c:91: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 mgp_charset[256];
data/mgp-1.13a+upstream20090219/image/faces.c:91: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          fname[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/faces.c:92: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          lname[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/faces.c:93: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          buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/fbm.c:130: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).
  fbmin_img_width    = atoi(phdr.cols);
data/mgp-1.13a+upstream20090219/image/fbm.c:131: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).
  fbmin_img_height   = atoi(phdr.rows);
data/mgp-1.13a+upstream20090219/image/fbm.c:132: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).
  fbmin_img_depth    = atoi(phdr.planes);
data/mgp-1.13a+upstream20090219/image/fbm.c:133: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).
  fbmin_img_bits     = atoi(phdr.bits);
data/mgp-1.13a+upstream20090219/image/fbm.c:134: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).
  fbmin_img_rowlen   = atoi(phdr.rowlen);
data/mgp-1.13a+upstream20090219/image/fbm.c:135: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).
  fbmin_img_plnlen   = atoi(phdr.plnlen);
data/mgp-1.13a+upstream20090219/image/fbm.c:136: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).
  fbmin_img_clrlen   = atoi(phdr.clrlen);
data/mgp-1.13a+upstream20090219/image/fbm.c:137: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).
  fbmin_img_aspect   = atoi(phdr.aspect);
data/mgp-1.13a+upstream20090219/image/fbm.c:138: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).
  fbmin_img_physbits = atoi(phdr.physbits);
data/mgp-1.13a+upstream20090219/image/fbm.h:34:2:  [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	magic[8];		/* 2 bytes FBM_MAGIC number */
data/mgp-1.13a+upstream20090219/image/fbm.h:35:2:  [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	cols[8];		/* Width in pixels */
data/mgp-1.13a+upstream20090219/image/fbm.h:36:2:  [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	rows[8];		/* Height in pixels */
data/mgp-1.13a+upstream20090219/image/fbm.h:37:2:  [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	planes[8];		/* Depth (1 for B+W, 3 for RGB) */
data/mgp-1.13a+upstream20090219/image/fbm.h:38:2:  [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	bits[8];		/* Bits per pixel */
data/mgp-1.13a+upstream20090219/image/fbm.h:39:2:  [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	physbits[8];		/* Bits to store each pixel */
data/mgp-1.13a+upstream20090219/image/fbm.h:40:2:  [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	rowlen[12];		/* Length of a row in bytes */
data/mgp-1.13a+upstream20090219/image/fbm.h:41:2:  [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	plnlen[12];		/* Length of a plane in bytes */
data/mgp-1.13a+upstream20090219/image/fbm.h:42:2:  [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	clrlen[12];		/* Length of colormap in bytes */
data/mgp-1.13a+upstream20090219/image/fbm.h:43:2:  [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	aspect[12];		/* ratio of Y to X of one pixel */
data/mgp-1.13a+upstream20090219/image/fbm.h:44:2:  [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	title[FBM_MAX_TITLE];	/* Null terminated title */
data/mgp-1.13a+upstream20090219/image/fbm.h:45:2:  [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	credits[FBM_MAX_TITLE];	/* Null terminated credits */
data/mgp-1.13a+upstream20090219/image/gif.c:84: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(ScreenBuffer[i], ScreenBuffer[0], Size);
data/mgp-1.13a+upstream20090219/image/image.h:39:9:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#ifndef bcopy
data/mgp-1.13a+upstream20090219/image/image.h:40:9:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define bcopy(P1,P2,N) memcpy((char *)(P2),(char *)(P1),(N))
data/mgp-1.13a+upstream20090219/image/image.h:40:24:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define bcopy(P1,P2,N) memcpy((char *)(P2),(char *)(P1),(N))
data/mgp-1.13a+upstream20090219/image/image.h:53: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          buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/imagetypes.c:62: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   fullname[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/imagetypes.c:88: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 fullname[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/img.c:77: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.
	unsigned char inbuf[MAX_LITERAL], ichr;	/* Input buffer/char */
data/mgp-1.13a+upstream20090219/image/img.c:192: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.
	unsigned char junkbuffer[MAX_SCANLINE];	/* scrap buffer */
data/mgp-1.13a+upstream20090219/image/imlib_loader.c:12: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 imfile[IMFILENUM][1024];
data/mgp-1.13a+upstream20090219/image/jpeg.c:228:4:  [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(bufp, pixel_data[0][row], width);
data/mgp-1.13a+upstream20090219/image/jpeg.c:663: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((void *) (*htblptr)->bits, (void *) bits, 
data/mgp-1.13a+upstream20090219/image/jpeg.c:665: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((void *) (*htblptr)->huffval, (void *) huffval, 
data/mgp-1.13a+upstream20090219/image/jpeg.c:2385: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 huffsize[257];
data/mgp-1.13a+upstream20090219/image/jpeg.c:3357: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((void *)outptr, (void *)inptr, count);
data/mgp-1.13a+upstream20090219/image/jpeg.h:255:2:  [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 ehufsi[256];	/* length of code for each symbol */
data/mgp-1.13a+upstream20090219/image/jpeg.h:744:6:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    (bcopy((void *) (input_row), (void *) (output_row), \
data/mgp-1.13a+upstream20090219/image/mcidas.h:34:10:  [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.
/* 25 */ char	comments[COMMENTLEN] ;
data/mgp-1.13a+upstream20090219/image/mcidas.h:49:10:  [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.
/* 52 */ char	stype[TYPELEN] ;
data/mgp-1.13a+upstream20090219/image/mcidas.h:50:10:  [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.
/* 53 */ char	ctype[TYPELEN] ;
data/mgp-1.13a+upstream20090219/image/mcidas.h:59: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.
/*   1 */ char	type[TYPELEN] ;
data/mgp-1.13a+upstream20090219/image/mcidas.h:66: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.
/* 121 */ char	memo[COMMENTLEN] ;
data/mgp-1.13a+upstream20090219/image/misc.c:23:10:  [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 buf[32];
data/mgp-1.13a+upstream20090219/image/misc.c:35: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(buf, "Signal %d", sig);
data/mgp-1.13a+upstream20090219/image/misc.c:246: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 errortext[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:32:12:  [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         *Paths[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:33: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         *Exts[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:44: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          tokenbuf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c: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          buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:51:13:  [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 (! (f= fopen(name, "r")))
data/mgp-1.13a+upstream20090219/image/path.c:118: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           buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:125: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(buf, "/sys$scratch/.xloadimagerc");
data/mgp-1.13a+upstream20090219/image/path.c:169:3:  [2] (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 string.
  strcat(fullname, ".Z");
data/mgp-1.13a+upstream20090219/image/path.c:179:5:  [2] (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 string.
    strcat(fullname, ".Z");
data/mgp-1.13a+upstream20090219/image/path.c:188:7:  [2] (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 string.
      strcat(fullname, ".Z");
data/mgp-1.13a+upstream20090219/image/path.c:200:5:  [2] (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 string.
    strcat(fullname, ".Z");
data/mgp-1.13a+upstream20090219/image/path.c:214: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         buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/path.c:255: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 buf1[BUFSIZ], buf2[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/pbm.h:9:12:  [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.
  unsigned char width[2];
data/mgp-1.13a+upstream20090219/image/pbm.h:10:12:  [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.
  unsigned char height[2];
data/mgp-1.13a+upstream20090219/image/png.c:60:2:  [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 			header[PNG_CHECK_BYTES], *destptr;
data/mgp-1.13a+upstream20090219/image/png.c:70:13:  [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 (!(fp = fopen(fullname, "rb"))) return NULL;
data/mgp-1.13a+upstream20090219/image/png.c:163: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(destptr + width * row * 3, row_pointers[row], width * 3);
data/mgp-1.13a+upstream20090219/image/png.c:176:4:  [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(destptr + width * row * 3, row_pointers[row], width * 3);
data/mgp-1.13a+upstream20090219/image/reduce.c:378: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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/rle.c:381:4:  [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(bufp,&scan[0][0],x_len);
data/mgp-1.13a+upstream20090219/image/rle.h:53:9:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#ifndef bcopy
data/mgp-1.13a+upstream20090219/image/rle.h:54:10:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
# define bcopy(xx,yy,zz) memcpy((char *)(yy),(char *)(xx),(int)(zz))
data/mgp-1.13a+upstream20090219/image/rle.h:54:26:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
# define bcopy(xx,yy,zz) memcpy((char *)(yy),(char *)(xx),(int)(zz))
data/mgp-1.13a+upstream20090219/image/rle.h:120:5:  [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    sv_bits[256/8];
data/mgp-1.13a+upstream20090219/image/rlelib.c:356:18:  [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.
union { short s; char c[2]; } arg;
data/mgp-1.13a+upstream20090219/image/rlelib.c:1130:13:  [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.
	    bfill((char *)scanline[-1], globals->sv_xmax + 1, 0);
data/mgp-1.13a+upstream20090219/image/rlelib.c:1133:10:  [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.
		bfill((char *)scanline[nc], globals->sv_xmax+1,
data/mgp-1.13a+upstream20090219/image/rotate.c: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 buf[BUFSIZ];			/* New title                   */
data/mgp-1.13a+upstream20090219/image/send.c:25:5:  [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 buf[MAXERRORLEN+1];
data/mgp-1.13a+upstream20090219/image/send.c:454: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(data, image->data, ((image->width + 7) / 8) * image->height);
data/mgp-1.13a+upstream20090219/image/sunraster.h:14:12:  [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.
  unsigned char magic[4];   /* magic number */
data/mgp-1.13a+upstream20090219/image/sunraster.h:15:12:  [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.
  unsigned char width[4];   /* width of image in pixels */
data/mgp-1.13a+upstream20090219/image/sunraster.h:16:12:  [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.
  unsigned char height[4];  /* height of image in pixels */
data/mgp-1.13a+upstream20090219/image/sunraster.h:17:12:  [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.
  unsigned char depth[4];   /* depth of each pixel */
data/mgp-1.13a+upstream20090219/image/sunraster.h:18:12:  [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.
  unsigned char length[4];  /* length of the image in bytes */
data/mgp-1.13a+upstream20090219/image/sunraster.h:19:12:  [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.
  unsigned char type[4];    /* format of file */
data/mgp-1.13a+upstream20090219/image/sunraster.h:20:12:  [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.
  unsigned char maptype[4]; /* type of colormap */
data/mgp-1.13a+upstream20090219/image/sunraster.h:21:12:  [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.
  unsigned char maplen[4];  /* length of colormap in bytes */
data/mgp-1.13a+upstream20090219/image/window.c:261:10:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/window.c:581:5:  [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                def_geom[30];
data/mgp-1.13a+upstream20090219/image/window.c:583: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(def_geom, "%ux%u+0+0", image->width, image->height);
data/mgp-1.13a+upstream20090219/image/window.c:886: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 buf[128];
data/mgp-1.13a+upstream20090219/image/xbitmap.c:136: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          line[MAX_SIZE];
data/mgp-1.13a+upstream20090219/image/xbitmap.c:137: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_and_type[MAX_SIZE];
data/mgp-1.13a+upstream20090219/image/xpixmap.c: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           buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/xpixmap.c:48: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           what[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/zio.c:76: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(buf + bread, zf->dataptr->buf + zf->bufptr, readlen);
data/mgp-1.13a+upstream20090219/image/zio.c:145: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   buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/image/zio.c:224:20:  [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).
      (zf->stream= fopen(name, "r", "ctx=bin", "ctx=stm", "rfm=stmlf"))
data/mgp-1.13a+upstream20090219/image/zio.c:226:20:  [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).
      (zf->stream= fopen(name, "r"))
data/mgp-1.13a+upstream20090219/image/zoom.c: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          buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/m17n.c:512: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 color_string[20];
data/mgp-1.13a+upstream20090219/m17n.c:520: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 (color_string, "#%04X%04X%04X",
data/mgp-1.13a+upstream20090219/m17n.c:708:53:  [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).
    mface_put_prop (face, key_sym, value ? (void *) atoi (value) : (void *) 1); 
data/mgp-1.13a+upstream20090219/mgp.c:213:2:  [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 buf[BUFSIZ], *p, *p2;
data/mgp-1.13a+upstream20090219/mgp.c:274:43:  [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).
			if (isdigit(optarg[0])) demointerval = atoi(optarg);
data/mgp-1.13a+upstream20090219/mgp.c:311:17:  [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).
			start_page = atoi(optarg);
data/mgp-1.13a+upstream20090219/mgp.c:332:12:  [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).
			t_fin = atoi(optarg);
data/mgp-1.13a+upstream20090219/mgp.c:337:25:  [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).
			b_quality[caching] = atoi(optarg);
data/mgp-1.13a+upstream20090219/mgp.c:408:18:  [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).
				cache_mode = atoi(p2);
data/mgp-1.13a+upstream20090219/mgp.c:410: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).
				cache_effect = atoi(p2);
data/mgp-1.13a+upstream20090219/mgp.c:412:19:  [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).
				cache_value = atoi(p2);
data/mgp-1.13a+upstream20090219/mgp.c:501:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/mgp.c:532:7:  [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).
	fd = open(buf, O_WRONLY | O_CREAT, 0644);
data/mgp-1.13a+upstream20090219/mgp.c:579:10:  [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).
		html = fopen(buf, "w");
data/mgp-1.13a+upstream20090219/mgp.c:625:9:  [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).
		txt = fopen(buf, "w");
data/mgp-1.13a+upstream20090219/mgp.c:665:9:  [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).
	html = fopen(buf, "w");
data/mgp-1.13a+upstream20090219/mgp.c:831:10:  [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).
				fd = open(tsfile, O_WRONLY|O_TRUNC|O_CREAT,
data/mgp-1.13a+upstream20090219/mgp.h:609: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.
extern char *page_data[MAXPAGE][MAXLINE];
data/mgp-1.13a+upstream20090219/mgp.h:656: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.
extern char mgp_charset[256];
data/mgp-1.13a+upstream20090219/missing/mkstemp.c:36:1:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
mkstemp(template)
data/mgp-1.13a+upstream20090219/missing/mkstemp.c:51:15:  [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).
	while ((fd = open(template, O_CREAT|O_EXCL|O_RDWR, 0600)) < 0) {
data/mgp-1.13a+upstream20090219/mng.c:71: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).
	mymng->file = fopen(mymng->filename, "rb");
data/mgp-1.13a+upstream20090219/mng.c:215:2:  [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		chunk[5];
data/mgp-1.13a+upstream20090219/parse.c:70:2:  [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 rc[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/parse.c:77:8:  [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).
		fp = fopen(dir,"r");
data/mgp-1.13a+upstream20090219/parse.c:87:8:  [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).
		fp = fopen(rc, "r");
data/mgp-1.13a+upstream20090219/parse.c:95:12:  [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 ((fp = fopen(filename, "r")) == NULL) {
data/mgp-1.13a+upstream20090219/parse.c:282:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/parse.c:376:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/parse.c:377:2:  [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 buf2[BUFSIZ];
data/mgp-1.13a+upstream20090219/parse.c:385:2:  [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 filtername[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/parse.c:672:17:  [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).
					filterfd = open("/dev/null", O_WRONLY);
data/mgp-1.13a+upstream20090219/parse.c:673:6:  [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(filtername, "/dev/null");
data/mgp-1.13a+upstream20090219/parse.c:677: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(filtername, "/tmp/%d.%ld.%d",
data/mgp-1.13a+upstream20090219/parse.c:680:17:  [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).
				filtertmp = open(filtername, O_CREAT|O_WRONLY,
data/mgp-1.13a+upstream20090219/parse.c:732: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).
				filterfp = fopen(filtername, "r");
data/mgp-1.13a+upstream20090219/parse.c:803: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(&buf[0], &buf[1], strlen(buf));
data/mgp-1.13a+upstream20090219/parse.c:1676:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/parse.c:1778:2:  [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(dst, src, sizeof(struct ctrl));
data/mgp-1.13a+upstream20090219/parse.c:1783: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(dst, src, sizeof(struct ctrl));
data/mgp-1.13a+upstream20090219/parse.c:1798:2:  [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(dst, src, sizeof(struct ctrl));
data/mgp-1.13a+upstream20090219/parse.c:1902:2:  [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 buf[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/parse.c:1917:8:  [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).
		fp = fopen(buf, mode);
data/mgp-1.13a+upstream20090219/plist.c:125:2:  [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 buf[10];
data/mgp-1.13a+upstream20090219/plist.c:130:2:  [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(buf, "%02d", i % 100);
data/mgp-1.13a+upstream20090219/plist.c:146:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/plist.c:223:2:  [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 buf[BUFSIZ], *p;
data/mgp-1.13a+upstream20090219/postscript.c:43:2:  [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 buf[BUFSIZ];
data/mgp-1.13a+upstream20090219/postscript.c:47:10:  [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).
	epsfp = fopen(fname, "r");
data/mgp-1.13a+upstream20090219/print.c:59: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 outputfile[MAXVALLEN];
data/mgp-1.13a+upstream20090219/print.c:393:13:  [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 ((fp = fopen(outputfile, "w")) == NULL) {
data/mgp-1.13a+upstream20090219/print.c:1550:2:  [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 buf[4096];
data/mgp-1.13a+upstream20090219/print.c:1563:4:  [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(q, "%04x ", code);
data/mgp-1.13a+upstream20090219/print.c:1601:9:  [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 epsfile[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/print.c:1602:9:  [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 fullname[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/print.c:1612:4:  [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(p, ".eps");
data/mgp-1.13a+upstream20090219/print.c:1899:11:  [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).
		epsfp = fopen(p, "r");
data/mgp-1.13a+upstream20090219/print.c:2233:2:  [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 line1[BUFSIZ];
data/mgp-1.13a+upstream20090219/print.c:2234:2:  [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 line2[BUFSIZ];
data/mgp-1.13a+upstream20090219/print.c:2235:2:  [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[BUFSIZ];
data/mgp-1.13a+upstream20090219/print.c:2355:9:  [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 pathbuf[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/print.c:2392: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).
			paper_xmargin = atoi(optarg);
data/mgp-1.13a+upstream20090219/print.c:2396: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).
			paper_ymargin = atoi(optarg);
data/mgp-1.13a+upstream20090219/print.c:2444:15:  [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).
			gaplevel = atoi(optarg);
data/mgp-1.13a+upstream20090219/print.c:2567:9:  [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 fontname[10];
data/mgp-1.13a+upstream20090219/print.c:2569:2:  [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(fontname, "F%03d", font->fontid);
data/mgp-1.13a+upstream20090219/print.c:2649:2:  [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		pathname[256];
data/mgp-1.13a+upstream20090219/tfont.c:51: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 *tf_curname[4]; /* contains iso8859-[2-4] fonts */
data/mgp-1.13a+upstream20090219/tfont.c:61: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 tfloadedfont[1024][TFFONT_NUM];
data/mgp-1.13a+upstream20090219/tfont.c:214:2:  [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 pathname[MAXPATHLEN];
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:127:22:  [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).
		p = (char *)malloc(strlen("/dev/") + strlen(remote) + 1);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:127:40:  [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).
		p = (char *)malloc(strlen("/dev/") + strlen(remote) + 1);
data/mgp-1.13a+upstream20090219/contrib/xmindpath/main.c:212:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			len = read(fd, buf, sizeof(buf));
data/mgp-1.13a+upstream20090219/contrib/xmindpath/uucplock.c:70:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(fd, &pid, sizeof(pid)) != sizeof(pid)) {
data/mgp-1.13a+upstream20090219/contrib/xwintoppm/xwintoppm.c:388:21:  [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).
    win_name_size = strlen(win_name) + sizeof(char);
data/mgp-1.13a+upstream20090219/ctlwords.c:39:7:  [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(buf) > 12 /* there must be enough data... */
data/mgp-1.13a+upstream20090219/draw.c:450:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			&&  read(0, &c, sizeof(c)) == sizeof(c)) {
data/mgp-1.13a+upstream20090219/draw.c:1205:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(CUTIN_DELAY);
data/mgp-1.13a+upstream20090219/draw.c:1258:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(SHRINK_DELAY);
data/mgp-1.13a+upstream20090219/draw.c:2524: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(tmp2, "*");
data/mgp-1.13a+upstream20090219/draw.c:3588:4:  [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).
			strlen(cp->ctic_value))) {
data/mgp-1.13a+upstream20090219/draw.c:3779: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).
			q += strlen(q);
data/mgp-1.13a+upstream20090219/draw.c:3892: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).
			q += strlen(q);
data/mgp-1.13a+upstream20090219/draw.c:3943:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(EXEC_DELAY);
data/mgp-1.13a+upstream20090219/draw.c:4064: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).
			q += strlen(q);
data/mgp-1.13a+upstream20090219/draw.c:4252:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
          usleep(WAITTIME);
data/mgp-1.13a+upstream20090219/draw.c:5122:6:  [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(registry) == 9 && !strncmp("iso8859-", registry, 8) &&
data/mgp-1.13a+upstream20090219/draw.c:5280:17:  [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).
		ileft = len + strlen(prefix[i]); oleft = sizeof(out16);
data/mgp-1.13a+upstream20090219/draw.c:5610:18:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		if (i < ratio) usleep(10000);
data/mgp-1.13a+upstream20090219/draw.c:5641:14:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		if (i > 0) usleep(10000);
data/mgp-1.13a+upstream20090219/embed.c:54:31:  [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(fname, EMBEDDIR, strlen(EMBEDDIR)) != 0)
data/mgp-1.13a+upstream20090219/embed.c:56: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).
	fname += strlen(EMBEDDIR);
data/mgp-1.13a+upstream20090219/embed.c:111: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).
	len = strlen(p->ctc_value);
data/mgp-1.13a+upstream20090219/image/bright.c:186:36:  [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).
	newimage->title = (char *)lmalloc(strlen(image->title) + 14);
data/mgp-1.13a+upstream20090219/image/dither.c:75:36:  [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).
    image->title = (char *)lmalloc(strlen(cimage->title) + 12);
data/mgp-1.13a+upstream20090219/image/faces.c:112:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(fname, buf + 11, MAXFACESNAME);
data/mgp-1.13a+upstream20090219/image/faces.c:115:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(lname, buf + 10, MAXFACESNAME);
data/mgp-1.13a+upstream20090219/image/faces.c:140: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).
  fname[strlen(fname) - 1]= ' ';
data/mgp-1.13a+upstream20090219/image/faces.c:142: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).
  fname[strlen(fname) - 1]= '\0';
data/mgp-1.13a+upstream20090219/image/halftone.c:180:35:  [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).
    image->title= (char *)lmalloc(strlen(cimage->title) + 13);
data/mgp-1.13a+upstream20090219/image/new.c:79:22:  [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).
  d= (char *)lmalloc(strlen(s) + 1);
data/mgp-1.13a+upstream20090219/image/path.c:58: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).
    l= strlen(tokenbuf);
data/mgp-1.13a+upstream20090219/image/path.c:66:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (((c= fgetc(f)) != '\n') && (c != EOF))
data/mgp-1.13a+upstream20090219/image/path.c:72:39:  [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(tokenbuf, PathToken, strlen(PathToken))) {
data/mgp-1.13a+upstream20090219/image/path.c:74:29:  [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 (sscanf(tokenbuf + strlen(PathToken), "%s", buf) != 1)
data/mgp-1.13a+upstream20090219/image/path.c:77:43:  [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).
    else if (!strncmp(tokenbuf, ExtToken, strlen(ExtToken))) {
data/mgp-1.13a+upstream20090219/image/path.c:79:29:  [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 (sscanf(tokenbuf + strlen(ExtToken), "%s", buf) != 1)
data/mgp-1.13a+upstream20090219/image/path.c:273:12:  [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).
      b1 = strlen(buf1);
data/mgp-1.13a+upstream20090219/image/path.c:281:7:  [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).
	b1 = strlen(buf1);
data/mgp-1.13a+upstream20090219/image/path.c:306:12:  [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((b2 = strlen(buf1)) > 0) {
data/mgp-1.13a+upstream20090219/image/smooth.c:30:35:  [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).
      new->title= (char *)lmalloc(strlen(image->title) + 12);
data/mgp-1.13a+upstream20090219/image/window.c:267:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(buf, s, BUFSIZ - 1);
data/mgp-1.13a+upstream20090219/image/xbitmap.c:155: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).
    if (strlen(line) == MAX_SIZE-1) {
data/mgp-1.13a+upstream20090219/image/zio.c:206: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(name) > 2) && !strcmp(".Z", name + (strlen(name) - 2))) {
data/mgp-1.13a+upstream20090219/image/zio.c:206:51:  [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(name) > 2) && !strcmp(".Z", name + (strlen(name) - 2))) {
data/mgp-1.13a+upstream20090219/m17n.c:146:15:  [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).
	int i, len = strlen ((char *) p);
data/mgp-1.13a+upstream20090219/m17n.c:258:28:  [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).
      char *copy = alloca (strlen (seed) + 1);
data/mgp-1.13a+upstream20090219/mgp.h:831:13:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
extern void usleep __P((u_int));
data/mgp-1.13a+upstream20090219/missing/strdup.c:42:21:  [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).
	p = (char *)malloc(strlen(str) + 1);
data/mgp-1.13a+upstream20090219/missing/strlcat.c:48:17:  [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).
		return(dlen + strlen(s));
data/mgp-1.13a+upstream20090219/missing/usleep.c:45:1:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
usleep(usec)
data/mgp-1.13a+upstream20090219/mng.c:309:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(mymng->delay * 1000);
data/mgp-1.13a+upstream20090219/parse.c:166: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).
	len = strlen(s);
data/mgp-1.13a+upstream20090219/parse.c:294: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 (buf[strlen(buf) - 1] == '\n')
data/mgp-1.13a+upstream20090219/parse.c:295: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).
			buf[strlen(buf) - 1] = '\0';
data/mgp-1.13a+upstream20090219/parse.c:411: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 (buf[strlen(buf) - 1] == '\n')
data/mgp-1.13a+upstream20090219/parse.c:412: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).
			buf[strlen(buf) - 1] = '\0';
data/mgp-1.13a+upstream20090219/parse.c:550:25:  [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).
			write(filterfd, buf, strlen(buf));
data/mgp-1.13a+upstream20090219/parse.c:557:13:  [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).
		p = buf + strlen(buf);
data/mgp-1.13a+upstream20090219/parse.c:586:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(p, q, sizeof(buf) - (p - buf));
data/mgp-1.13a+upstream20090219/parse.c:588: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).
			p += strlen(p);
data/mgp-1.13a+upstream20090219/parse.c:803:30:  [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).
				memcpy(&buf[0], &buf[1], strlen(buf));
data/mgp-1.13a+upstream20090219/plist.c:301:12:  [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).
	p = buf + strlen(buf) - 1;
data/mgp-1.13a+upstream20090219/plist.c:310:10:  [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).
				buf, strlen(buf));
data/mgp-1.13a+upstream20090219/plist.c:311:31:  [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).
			x += XTextWidth(plfs, buf, strlen(buf));
data/mgp-1.13a+upstream20090219/plist.c:319:21:  [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).
				(XChar2b *)buf, strlen(buf)/2);
data/mgp-1.13a+upstream20090219/plist.c:320:45:  [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).
			x += XTextWidth16(plkfs, (XChar2b *)buf, strlen(buf)/2);
data/mgp-1.13a+upstream20090219/plist.c:326:51:  [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).
		XDrawImageString(display, d, gc_pta, x, y, buf, strlen(buf));
data/mgp-1.13a+upstream20090219/plist.c:327:30:  [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).
		x += XTextWidth(plfs, buf, strlen(buf));
data/mgp-1.13a+upstream20090219/print.c:1452:4:  [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).
			strlen(cp->ctic_value)))
data/mgp-1.13a+upstream20090219/print.c:2470:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(pathbuf, mgp_fname, sizeof(pathbuf));

ANALYSIS SUMMARY:

Hits = 412
Lines analyzed = 42992 in approximately 1.25 seconds (34513 lines/second)
Physical Source Lines of Code (SLOC) = 32382
Hits@level = [0] 942 [1]  71 [2] 237 [3]  11 [4]  93 [5]   0
Hits@level+ = [0+] 1354 [1+] 412 [2+] 341 [3+] 104 [4+]  93 [5+]   0
Hits/KSLOC@level+ = [0+] 41.8134 [1+] 12.7231 [2+] 10.5305 [3+] 3.21166 [4+] 2.87197 [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.