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/xpat2-1.07/makecards/French/config.h
Examining data/xpat2-1.07/makecards/Louis-XV/config.h
Examining data/xpat2-1.07/makecards/American/config.h
Examining data/xpat2-1.07/makecards/src/combine.c
Examining data/xpat2-1.07/makecards/src/rank.c
Examining data/xpat2-1.07/makecards/Stein/config.h
Examining data/xpat2-1.07/etc/wavplay.c
Examining data/xpat2-1.07/src/X-gfx2.c
Examining data/xpat2-1.07/src/version.h
Examining data/xpat2-1.07/src/moves.c
Examining data/xpat2-1.07/src/Tableau.h
Examining data/xpat2-1.07/src/TableauP.h
Examining data/xpat2-1.07/src/X-arrows.c
Examining data/xpat2-1.07/src/X-cards.c
Examining data/xpat2-1.07/src/X-events.c
Examining data/xpat2-1.07/src/X-expose.c
Examining data/xpat2-1.07/src/X-layout.c
Examining data/xpat2-1.07/src/X-markcard.c
Examining data/xpat2-1.07/src/X-pat.h
Examining data/xpat2-1.07/src/rules.c
Examining data/xpat2-1.07/src/Xaw-help.c
Examining data/xpat2-1.07/src/Xlib-buttons.c
Examining data/xpat2-1.07/src/Xlib-events.c
Examining data/xpat2-1.07/src/Xlib-main.c
Examining data/xpat2-1.07/src/r_Michaels.c
Examining data/xpat2-1.07/src/Xlib-windows.c
Examining data/xpat2-1.07/src/hints.c
Examining data/xpat2-1.07/src/messages.c
Examining data/xpat2-1.07/src/r_Delight.c
Examining data/xpat2-1.07/src/r_FreeCell.c
Examining data/xpat2-1.07/src/r_Gypsy.c
Examining data/xpat2-1.07/src/r_Klondike.c
Examining data/xpat2-1.07/src/r_Royal.c
Examining data/xpat2-1.07/src/r_Midnight.c
Examining data/xpat2-1.07/src/r_MonteCarlo.c
Examining data/xpat2-1.07/src/r_Seahaven.c
Examining data/xpat2-1.07/src/r_Spider.c
Examining data/xpat2-1.07/src/util.c
Examining data/xpat2-1.07/src/r_Canfield.c
Examining data/xpat2-1.07/src/xpatgame.h
Examining data/xpat2-1.07/src/r_Bakers.c
Examining data/xpat2-1.07/src/X-sound_SUN.c
Examining data/xpat2-1.07/src/X-sound_FM.c
Examining data/xpat2-1.07/src/r_Calculatio.c
Examining data/xpat2-1.07/src/r_mdCanfield.c
Examining data/xpat2-1.07/src/Xv-main.c
Examining data/xpat2-1.07/src/Xv-events.c
Examining data/xpat2-1.07/src/testit2.c
Examining data/xpat2-1.07/src/r_Oonsoo.c
Examining data/xpat2-1.07/src/r_BlueMoon.c
Examining data/xpat2-1.07/src/X-loadcards.c
Examining data/xpat2-1.07/src/xpatgeo.h
Examining data/xpat2-1.07/src/usage.c
Examining data/xpat2-1.07/src/arrows.c
Examining data/xpat2-1.07/src/XQtCrdsDlg.cpp
Examining data/xpat2-1.07/src/XQtTableau.h
Examining data/xpat2-1.07/src/XQtWindow.h
Examining data/xpat2-1.07/src/XQtCards.cpp
Examining data/xpat2-1.07/src/XQtWindow.cpp
Examining data/xpat2-1.07/src/XQt-main.cpp
Examining data/xpat2-1.07/src/options.c
Examining data/xpat2-1.07/src/XQtCrdPile.cpp
Examining data/xpat2-1.07/src/XQtMarkCrd.cpp
Examining data/xpat2-1.07/src/qmaskedit.h
Examining data/xpat2-1.07/src/qmaskedit.cpp
Examining data/xpat2-1.07/src/qhelpwin.cpp
Examining data/xpat2-1.07/src/qhelpwin.h
Examining data/xpat2-1.07/src/XQtCards.h
Examining data/xpat2-1.07/src/XQtCardPile.h
Examining data/xpat2-1.07/src/XQtTableau.cpp
Examining data/xpat2-1.07/src/XQtArrows.cpp
Examining data/xpat2-1.07/src/X-sound_NAS.c
Examining data/xpat2-1.07/src/Xm1-help.h
Examining data/xpat2-1.07/src/Xm1-main.c
Examining data/xpat2-1.07/src/Xm1-help.c
Examining data/xpat2-1.07/src/Xm-about.c
Examining data/xpat2-1.07/src/Xm-about.h
Examining data/xpat2-1.07/src/Xm-appif.c
Examining data/xpat2-1.07/src/Xm-appif.h
Examining data/xpat2-1.07/src/Xm-appwin.c
Examining data/xpat2-1.07/src/Xm-appwin.h
Examining data/xpat2-1.07/src/Xm-args.c
Examining data/xpat2-1.07/src/Xm-cbapp.c
Examining data/xpat2-1.07/src/Xm-cbapp.h
Examining data/xpat2-1.07/src/Xm-cbstd.c
Examining data/xpat2-1.07/src/Xm-cbstd.h
Examining data/xpat2-1.07/src/Xm-dialog.c
Examining data/xpat2-1.07/src/Xm-dialog.h
Examining data/xpat2-1.07/src/Xm-fbres.c
Examining data/xpat2-1.07/src/Xm-fbres.h
Examining data/xpat2-1.07/src/Xm-file.c
Examining data/xpat2-1.07/src/Xm-file.h
Examining data/xpat2-1.07/src/Xm-help.c
Examining data/xpat2-1.07/src/Xm-help.h
Examining data/xpat2-1.07/src/Xm-main.c
Examining data/xpat2-1.07/src/Xm-main.h
Examining data/xpat2-1.07/src/Xm-ostype.h
Examining data/xpat2-1.07/src/Xm-pixmap.c
Examining data/xpat2-1.07/src/Xm-pixmap.h
Examining data/xpat2-1.07/src/Xm-platform.c
Examining data/xpat2-1.07/src/Xm-platform.h
Examining data/xpat2-1.07/src/Xm-tbflatb.c
Examining data/xpat2-1.07/src/Xm-tbflatb.h
Examining data/xpat2-1.07/src/moc_XQtCP.cpp
Examining data/xpat2-1.07/src/moc_XQtT.cpp
Examining data/xpat2-1.07/src/moc_XQtW.cpp
Examining data/xpat2-1.07/src/moc_XQtC.cpp
Examining data/xpat2-1.07/src/mqmaskedit.cpp
Examining data/xpat2-1.07/src/mqhelpwin.cpp
Examining data/xpat2-1.07/src/xpat.h
Examining data/xpat2-1.07/src/X-widget.c
Examining data/xpat2-1.07/src/Xaw-main.c
Examining data/xpat2-1.07/src/X-gfx1.c
Examining data/xpat2-1.07/src/layout.c
Examining data/xpat2-1.07/src/commands.c
Examining data/xpat2-1.07/src/loadsave.c

FINAL RESULTS:

data/xpat2-1.07/makecards/src/combine.c:76:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(name, "%s.%s.pic.xpm", US_rank_name[r], US_suit_name[s]);
data/xpat2-1.07/makecards/src/combine.c:115:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(name, "%s.%s.pic.xpm", US_rank_name[r], US_suit_name[s]);
data/xpat2-1.07/src/X-gfx1.c:429:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(s, "%s/%s", LIBDIR, xpm);
data/xpat2-1.07/src/X-gfx1.c:447:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(s, "%s/Cards.conf", xpmdir);
data/xpat2-1.07/src/X-gfx1.c:962: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(s, xpmdir);
data/xpat2-1.07/src/X-gfx1.c:965:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf(s, "%s/%s.%s.xpm", xpmdir,
data/xpat2-1.07/src/X-gfx1.c:981:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(s, "%s.%s.xpm",
data/xpat2-1.07/src/X-gfx1.c:993:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			    sprintf(s, "%s/Joker.xpm", xpmdir);
data/xpat2-1.07/src/X-gfx2.c:319:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buff, "%s/%s.%s", xpmdir, s, ext);
data/xpat2-1.07/src/X-gfx2.c:404:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(s, "%s/default", LIBDIR);
data/xpat2-1.07/src/X-gfx2.c:413:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(s, "%s%s", s2, xpm);
data/xpat2-1.07/src/X-gfx2.c:418:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(s, "%s/%s", LIBDIR, xpm);
data/xpat2-1.07/src/X-gfx2.c:423: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, xpm);
data/xpat2-1.07/src/X-gfx2.c:670:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(name, "%s.%s.pic", US_rank_name[rank], US_suit_name[suit]);
data/xpat2-1.07/src/X-gfx2.c:764:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(name, "%s.%s.pic", US_rank_name[rank], US_suit_name[suit]);
data/xpat2-1.07/src/X-gfx2.c:886:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(name, "Empty.%s", US_suit_name[SUIT(c)]);
data/xpat2-1.07/src/X-gfx2.c:890:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(name, "%s.%s.pic", US_rank_name[RANK(c)],
data/xpat2-1.07/src/X-loadcards.c:36:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(fullname, "%s/%s.cards", LIBDIR, file);
data/xpat2-1.07/src/X-sound_NAS.c:36:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(fullname, "%s/audio/%s.%s", LIBDIR, filename, NAS_AUDIO_EXT);
data/xpat2-1.07/src/X-sound_SUN.c:29:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(fullname, "%s/audio/%s.au", LIBDIR, filename);
data/xpat2-1.07/src/XQt-main.cpp:49:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(s, "argument to option \"%s\" / resource \"%s\"",
data/xpat2-1.07/src/XQtCards.cpp:22:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buff, "%s/%s.%s", xpmdir, file, ext ? ext : "xpm");
data/xpat2-1.07/src/XQtCards.cpp:320: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(directory, xpmdir);
data/xpat2-1.07/src/XQtCards.cpp:442:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(name, "%s.%s.pic", US_rank_name[rank], US_suit_name[suit]);
data/xpat2-1.07/src/XQtCards.cpp:489:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(name, "%s.%s.pic", US_rank_name[rank], US_suit_name[suit]);
data/xpat2-1.07/src/XQtCards.cpp:542:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(name, "Empty.%s", US_suit_name[suit]);
data/xpat2-1.07/src/XQtWindow.cpp:311:2:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	vsprintf(last_message, str, args);
data/xpat2-1.07/src/XQtWindow.cpp:597:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(pathname, "%s/%s/%s", LIBDIR, langdir, helpfilename);
data/xpat2-1.07/src/XQtWindow.cpp:599:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(pathname, "%s/%s", LIBDIR, helpfilename);
data/xpat2-1.07/src/XQtWindow.cpp:601:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(caption, "XPat2: Help on the rules of %s", rulepool[i]->shortname);
data/xpat2-1.07/src/XQtWindow.cpp:613:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(pathname, "%s/%s/%s", LIBDIR, langdir, "help.keys");
data/xpat2-1.07/src/XQtWindow.cpp:615:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(pathname, "%s/%s", LIBDIR, "help.keys");
data/xpat2-1.07/src/Xaw-help.c:47:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  	    sprintf(filename, "%s/%s/%s", LIBDIR, langdir, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xaw-help.c:48: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.
	    if (access(filename, R_OK))
data/xpat2-1.07/src/Xaw-help.c:52:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(filename, "%s/%s", LIBDIR, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xaw-help.c:54: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(filename, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xaw-help.c:82:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(s, TXT_HELP_RULES, (*rp)->shortname);
data/xpat2-1.07/src/Xaw-main.c:41:2:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	vsprintf(last_message, str, args);
data/xpat2-1.07/src/Xaw-main.c:260: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, "usage: xpat2 [options] [seed|loadfilename]\n"
data/xpat2-1.07/src/Xlib-buttons.c:28:2:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	vsprintf(last_message, str, args);
data/xpat2-1.07/src/Xlib-buttons.c:111:2:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	printf((i < rules.numstacks ? "Stack %d: " : "Slot %d: "),
data/xpat2-1.07/src/Xlib-main.c:79:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(s, "argument to option \"%s\" / resource \"%s\"",
data/xpat2-1.07/src/Xm-appif.c:98:5:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    vsprintf(message, string, strargs);
data/xpat2-1.07/src/Xm-cbapp.c:260:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(filename, "%s/%s/%s", LIBDIR, langdir, ((char *)client_data));
data/xpat2-1.07/src/Xm-cbapp.c:262: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(filename, ((char *)client_data));
data/xpat2-1.07/src/Xm1-help.c:49:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  	    sprintf(filename, "%s/%s/%s", LIBDIR, langdir, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xm1-help.c:50: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.
	    if (access(filename, R_OK))
data/xpat2-1.07/src/Xm1-help.c:54:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(filename, "%s/%s", LIBDIR, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xm1-help.c:57: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(filename, TXT_HELPFILES[i]);
data/xpat2-1.07/src/Xm1-help.c:62:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(warnstring, "Warning could not find %s\n", filename);
data/xpat2-1.07/src/Xm1-help.c:71:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(warnstring, "Warning file %s has zero size\n", filename);
data/xpat2-1.07/src/Xm1-main.c:59:2:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	vsprintf(last_message, str, args);
data/xpat2-1.07/src/Xv-main.c:110: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(buf, owner);
data/xpat2-1.07/src/Xv-main.c:112:5:  [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, name);
data/xpat2-1.07/src/Xv-main.c:121: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(cbuf, d_mk_name(cmd, res));
data/xpat2-1.07/src/Xv-main.c:122: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(Cbuf, d_mk_name("XPat", res));
data/xpat2-1.07/src/Xv-main.c:137: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(cbuf, d_mk_name(cmd, res));
data/xpat2-1.07/src/Xv-main.c:138: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(Cbuf, d_mk_name("XPat", res));
data/xpat2-1.07/src/Xv-main.c:580:5:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
    vsprintf(msg, fmt, args);
data/xpat2-1.07/src/commands.c:142: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(buff, xpat_messages[txtindex+0]);
data/xpat2-1.07/src/commands.c:145: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(buff, xpat_messages[txtindex+1]);
data/xpat2-1.07/src/commands.c:148:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(buff, xpat_messages[txtindex+2], n);
data/xpat2-1.07/src/commands.c:155:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(buf, TXT_INFO1, game.seed, game.cheat_count);
data/xpat2-1.07/src/commands.c:163:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf+strlen(buf), "%s", TXT_NOSCORE);
data/xpat2-1.07/src/hints.c:188: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, TXT_RANK[RANK(arg)]);
data/xpat2-1.07/src/hints.c:192: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, TXT_SUIT[SUIT(arg)]);
data/xpat2-1.07/src/hints.c:198: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(p, TXT_DECK);
data/xpat2-1.07/src/hints.c:201: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(p, TXT_IDECK);
data/xpat2-1.07/src/hints.c:204: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(p, TXT_SLOT);
data/xpat2-1.07/src/hints.c:209: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(p, TXT_STACK);
data/xpat2-1.07/src/hints.c:214: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(p, TXT_TMP);
data/xpat2-1.07/src/loadsave.c:195: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(buffer, rules.shortname);
data/xpat2-1.07/src/loadsave.c:273:21:  [4] (misc) getlogin:
  It's often easy to fool getlogin. Sometimes it does not work at all,
  because some program messed up the utmp file. Often, it gives only the
  first 8 characters of the login name. The user currently logged in on the
  controlling tty of our program need not be the user who started it. Avoid
  getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid())
  and extract the desired information instead.
    if ((username = getlogin()) != NULL
data/xpat2-1.07/src/loadsave.c:279:17:  [4] (misc) cuserid:
  Exactly what cuserid() does is poorly defined (e.g., some systems use the
  effective uid, like Linux, while others like System V use the real uid).
  Thus, you can't trust what it does. It's certainly not portable (The
  cuserid function was included in the 1988 version of POSIX, but removed
  from the 1990 version). Also, if passed a non-null parameter, there's a
  risk of a buffer overflow if the passed-in buffer is not at least L_cuserid
  characters long (CWE-120). Use getpwuid(geteuid()) and extract the desired
  information instead.
	|| (username = cuserid(NULL)) != NULL
data/xpat2-1.07/src/messages.c:173: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(p, txt);
data/xpat2-1.07/src/messages.c:199:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buff, "%s/%s", LIBDIR, langdir);
data/xpat2-1.07/src/messages.c:206: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.
    if (!access(buff, R_OK))	/* check access to directory */
data/xpat2-1.07/src/messages.c:242:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	  sprintf(pathname, "%s/%s/%s", LIBDIR, langdir, filename);
data/xpat2-1.07/src/messages.c:248:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(pathname, "%s/%s", LIBDIR, filename);
data/xpat2-1.07/src/messages.c:390:6:  [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+2, "%x %s", &c, buff);
data/xpat2-1.07/src/moves.c:715:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buff, "(Abbrev %-2s)", rulepool[i]->abbrev);
data/xpat2-1.07/src/X-gfx2.c:409:7:  [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.
	s2 = getenv("HOME");
data/xpat2-1.07/src/Xlib-main.c:47:24:  [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 ? display : getenv("DISPLAY")));
data/xpat2-1.07/src/messages.c:186: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.
    langdir = getenv("LANG");
data/xpat2-1.07/src/testit2.c:64:2:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srand(n+1234567L);
data/xpat2-1.07/etc/wavplay.c:34: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 c_RIFF[4];
data/xpat2-1.07/etc/wavplay.c:36: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 c_WAVE[4];
data/xpat2-1.07/etc/wavplay.c:38: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 c_fmt[4];
data/xpat2-1.07/etc/wavplay.c:47: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 c_data[4];
data/xpat2-1.07/etc/wavplay.c:116:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((fd_audio=open("/dev/dsp", O_WRONLY, 0)) == EOF) {
data/xpat2-1.07/etc/wavplay.c:205:7:  [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("/tmp/audio.wav", "wb");
data/xpat2-1.07/etc/wavplay.c:217: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).
    if ((fd = open(filename, O_RDONLY)) < 0) {
data/xpat2-1.07/makecards/src/combine.c:74:6:  [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[40];
data/xpat2-1.07/makecards/src/combine.c:113:6:  [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[40];
data/xpat2-1.07/makecards/src/rank.c:22:17:  [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 unsigned char grey[90][90];
data/xpat2-1.07/src/X-events.c:43: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 str[32];
data/xpat2-1.07/src/X-gfx1.c:233: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 _reverse_byte[0x100] = {
data/xpat2-1.07/src/X-gfx1.c:305: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(dst, new, W*H);
data/xpat2-1.07/src/X-gfx1.c:357: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(tmp, orgbits, cardsize);
data/xpat2-1.07/src/X-gfx1.c:364: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 new_bits[120/8 * 200];	/* sufficient for the largest bitmap here */
data/xpat2-1.07/src/X-gfx1.c:445:6:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	    char s[MAXXPMDIRLEN + 15];
data/xpat2-1.07/src/X-gfx1.c:448:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	    if ((fp = fopen(s, "r"))) {
data/xpat2-1.07/src/X-gfx1.c:959: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.
			    char s[MAXXPMDIRLEN + strlen(US_rank_name[RANK(i)]) +
data/xpat2-1.07/src/X-gfx1.c:963:12:  [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(s, "/Cardback.xpm");
data/xpat2-1.07/src/X-gfx1.c:980:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			char s[20];
data/xpat2-1.07/src/X-gfx1.c:992: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.
			    char s[MAXXPMDIRLEN + 15];
data/xpat2-1.07/src/X-gfx2.c:119:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(fp = fopen(filename, "r"))) {
data/xpat2-1.07/src/X-gfx2.c:318: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 buff[200];
data/xpat2-1.07/src/X-gfx2.c:632: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 name[32];
data/xpat2-1.07/src/X-gfx2.c:763:6:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	    char name[32];
data/xpat2-1.07/src/X-gfx2.c:876: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 name[200];
data/xpat2-1.07/src/X-gfx2.c:880:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(name, "Cardback%d", 1 +
data/xpat2-1.07/src/X-gfx2.c:883:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(name, "Joker%d", 1 + ((c - JOKER) + (int)((game.seed / cc.numbacks) & 0xfff))
data/xpat2-1.07/src/X-loadcards.c:11: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 fullname[200];
data/xpat2-1.07/src/X-loadcards.c:31: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 fill[14];           /* reserved for future requirements 			*/
data/xpat2-1.07/src/X-loadcards.c:39: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).
    fp = fopen(file, "r");
data/xpat2-1.07/src/X-sound_FM.c:27: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 sbbuf[404];
data/xpat2-1.07/src/X-sound_FM.c:44: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(&sbbuf[sbptr], msg, 4);
data/xpat2-1.07/src/X-sound_FM.c:49: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[4];
data/xpat2-1.07/src/X-sound_FM.c:57: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[4];
data/xpat2-1.07/src/X-sound_FM.c:76: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[4];
data/xpat2-1.07/src/X-sound_FM.c:105: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[100];
data/xpat2-1.07/src/X-sound_FM.c:128:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((sb=open("/dev/sequencer", O_WRONLY, 0))==-1) {
data/xpat2-1.07/src/X-sound_NAS.c:26: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[256];
data/xpat2-1.07/src/X-sound_SUN.c:21: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[200];
data/xpat2-1.07/src/X-sound_SUN.c:24:15:  [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 (!(fsnd = fopen(AUDIO_DEVICE, "wb"))) {
data/xpat2-1.07/src/X-sound_SUN.c:30: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"))) {
data/xpat2-1.07/src/XQt-main.cpp:46:21:  [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).
	    n = o->value ? atoi(o->value) : -1;
data/xpat2-1.07/src/XQt-main.cpp: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 s[100];
data/xpat2-1.07/src/XQtCards.cpp: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.
    static char buff[256];
data/xpat2-1.07/src/XQtCards.cpp:113:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(fp = fopen(filename, "r"))) {
data/xpat2-1.07/src/XQtCards.cpp:238: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 filename[12];
data/xpat2-1.07/src/XQtCards.cpp:243: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(filename, "Cardback%d", num);
data/xpat2-1.07/src/XQtCards.cpp:317: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 name[32];
data/xpat2-1.07/src/XQtWindow.cpp:303: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 last_message[256];
data/xpat2-1.07/src/XQtWindow.cpp:572: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 pathname[256];
data/xpat2-1.07/src/XQtWindow.cpp:573: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 caption[128];
data/xpat2-1.07/src/XQtWindow.cpp:607: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 pathname[256];
data/xpat2-1.07/src/Xaw-help.c:39: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 filename[256];
data/xpat2-1.07/src/Xaw-help.c:43:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    int i = atoi(s+4);
data/xpat2-1.07/src/Xaw-help.c:79:6:  [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 n[8], s[40];
data/xpat2-1.07/src/Xaw-help.c:80:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(n, "Help%d", rp-rulepool+5);
data/xpat2-1.07/src/Xaw-main.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 last_message[256];
data/xpat2-1.07/src/Xaw-main.c:289:18:  [2] (integer) atol:
  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).
	    game.seed = atol(argv[1]);
data/xpat2-1.07/src/Xlib-buttons.c:23: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 last_message[512] = " ";
data/xpat2-1.07/src/Xlib-buttons.c:101: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.
    static const char *vis[2] = { "hidden ", "" };
data/xpat2-1.07/src/Xlib-main.c:76:21:  [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).
	    n = o->value ? atoi(o->value) : -1;
data/xpat2-1.07/src/Xlib-main.c:78: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 s[100];
data/xpat2-1.07/src/Xm-appif.c:88: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	message[256];
data/xpat2-1.07/src/Xm-appwin.c:547: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	widgetname[32];
data/xpat2-1.07/src/Xm-appwin.c:560:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(widgetname, "toggleRules%d", index+1);
data/xpat2-1.07/src/Xm-appwin.c:572:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(widgetname, "butHelpRules%d", index+1);
data/xpat2-1.07/src/Xm-args.c:41: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	progname[256];
data/xpat2-1.07/src/Xm-args.c:90:23:  [2] (integer) atol:
  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).
          game.seed	= atol (argv[i]);
data/xpat2-1.07/src/Xm-cbapp.c:248: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	filename[1024];
data/xpat2-1.07/src/Xm-cbapp.c:259: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.
    if (((char *)client_data)[0] != '/')
data/xpat2-1.07/src/Xm-cbapp.c:271: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 (NULL == (fp = fopen(filename, "r")))
data/xpat2-1.07/src/Xm-file.c:154: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	widgetname[32];
data/xpat2-1.07/src/Xm-file.c:174:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(widgetname, "butFileSetfilter%d", index+1);
data/xpat2-1.07/src/Xm1-help.c:39: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 filename[256];
data/xpat2-1.07/src/Xm1-help.c:59: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).
    fd = fopen(filename, "r");
data/xpat2-1.07/src/Xm1-help.c:61: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 warnstring[300];
data/xpat2-1.07/src/Xm1-help.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 warnstring[300];
data/xpat2-1.07/src/Xm1-main.c:50: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 last_message[256];
data/xpat2-1.07/src/Xm1-main.c:236:18:  [2] (integer) atol:
  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).
	    game.seed = atol(argv[1]);
data/xpat2-1.07/src/Xm1-main.c:367:37:  [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.
	    str = XmStringCreateLocalized((char *) items[i].accel_text);
data/xpat2-1.07/src/Xm1-main.c:452:37:  [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.
	    str = XmStringCreateLocalized((char *) items[i].accel_text);
data/xpat2-1.07/src/Xv-main.c:108: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 buf[128];
data/xpat2-1.07/src/Xv-main.c:119: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 cbuf[128], Cbuf[128];
data/xpat2-1.07/src/Xv-main.c:130: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 cbuf[128], Cbuf[128];
data/xpat2-1.07/src/Xv-main.c:134:8:  [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).
	dft = atoi(dftv);
data/xpat2-1.07/src/Xv-main.c:288:13:  [2] (integer) atol:
  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).
	    seed = atol(argv[i]);
data/xpat2-1.07/src/Xv-main.c:311:15:  [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.
	    *((const char **) options[i].where) =
data/xpat2-1.07/src/Xv-main.c:317:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		(options[i].cmdarg? atoi(options[i].cmdarg):
data/xpat2-1.07/src/Xv-main.c:574: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 msg[512];
data/xpat2-1.07/src/commands.c:154: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[256];
data/xpat2-1.07/src/commands.c:161: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+strlen(buf), " %d.", rules.maxscore);
data/xpat2-1.07/src/commands.c:168: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[256];
data/xpat2-1.07/src/commands.c:174:6:  [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(buf, "  ");
data/xpat2-1.07/src/hints.c:206:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		    sprintf(p, " %d", arg - rules.numstacks + 1);
data/xpat2-1.07/src/hints.c:211:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		    sprintf(p, " %d", arg + 1);
data/xpat2-1.07/src/hints.c:216:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		    sprintf(p, " %d", arg-rules.numstacks-rules.numslots + 1);
data/xpat2-1.07/src/hints.c:233: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[180];
data/xpat2-1.07/src/loadsave.c:95: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 buffer[BUFSIZE];
data/xpat2-1.07/src/loadsave.c:98: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 p[NARGS * 4];
data/xpat2-1.07/src/loadsave.c:100:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(fp = fopen(file, "rb")))
data/xpat2-1.07/src/loadsave.c:160: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 buffer[BUFSIZE];
data/xpat2-1.07/src/loadsave.c:161: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 filename[64];	/* must be 15 at least */
data/xpat2-1.07/src/loadsave.c:164: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 p[4 * NARGS];
data/xpat2-1.07/src/loadsave.c:185:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(wr, ".%09ld", game.seed);
data/xpat2-1.07/src/loadsave.c:191:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(fp = fopen(file, "wb"))) {
data/xpat2-1.07/src/loadsave.c:265:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(fp = fopen(SCOREFILE, "a"))) {
data/xpat2-1.07/src/messages.c:179: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 iso_code[3] = { 0 };
data/xpat2-1.07/src/messages.c:181: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 buff[256];
data/xpat2-1.07/src/messages.c:236: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 pathname[256];
data/xpat2-1.07/src/messages.c:243:14:  [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(pathname, "r")))
data/xpat2-1.07/src/messages.c:249: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(pathname, "r")))
data/xpat2-1.07/src/messages.c:258: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 line[256];
data/xpat2-1.07/src/messages.c:358: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 line[256];
data/xpat2-1.07/src/messages.c:359: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 buff[32], cmd[2];
data/xpat2-1.07/src/messages.c:426: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 s[2];
data/xpat2-1.07/src/moves.c:425: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(tmp, game.cards+srcindex, numcards * sizeof(int));
data/xpat2-1.07/src/moves.c:436: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(game.cards+i, tmp, numcards * sizeof(int));
data/xpat2-1.07/src/moves.c:447: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(game.cards + game.ind[dstpile+1], tmp, numcards * sizeof(int));
data/xpat2-1.07/src/moves.c:541: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 xx[MAXPILES];
data/xpat2-1.07/src/moves.c:713:6:  [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 buff[20];
data/xpat2-1.07/src/moves.c:717:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(buff, "           ");
data/xpat2-1.07/src/options.c:104:13:  [2] (integer) atol:
  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).
	    seed = atol(argv[i]);
data/xpat2-1.07/src/qhelpwin.cpp:33:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ( !f.open( IO_ReadOnly ) )
data/xpat2-1.07/src/qmaskedit.cpp:65: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 buff[20];
data/xpat2-1.07/src/qmaskedit.cpp:68: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(buff, "%*d", fieldsize, val);
data/xpat2-1.07/src/qmaskedit.cpp:73: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).
    int val = atoi(text());
data/xpat2-1.07/src/qmaskedit.cpp:81: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).
    int num = atoi(text());
data/xpat2-1.07/src/qmaskedit.cpp:83: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 buff[20];
data/xpat2-1.07/src/qmaskedit.cpp:90: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(buff, "%*d", fieldsize, num);
data/xpat2-1.07/src/qmaskedit.cpp:105:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(buff, "%*d", fieldsize, num);
data/xpat2-1.07/src/testit2.c:59:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    int i, n = atoi(v[1]);
data/xpat2-1.07/etc/wavplay.c:221:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((cnt = read(fd, &wav_hdr, sizeof(wav_hdr))) != sizeof(wav_hdr)) {
data/xpat2-1.07/etc/wavplay.c:242:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (rest && (this = read(fd, ptr, rest))) {
data/xpat2-1.07/src/X-gfx1.c:428: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).
	s = malloc(strlen(LIBDIR) + strlen(xpm) + 2);
data/xpat2-1.07/src/X-gfx1.c:428: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).
	s = malloc(strlen(LIBDIR) + strlen(xpm) + 2);
data/xpat2-1.07/src/X-gfx1.c:959: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).
			    char s[MAXXPMDIRLEN + strlen(US_rank_name[RANK(i)]) +
data/xpat2-1.07/src/X-gfx1.c:960: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).
                                   strlen(US_suit_name[SUIT(i)]) + 20];
data/xpat2-1.07/src/X-gfx2.c:403: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).
	s = malloc(strlen(LIBDIR) + 10);
data/xpat2-1.07/src/X-gfx2.c:412: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).
	s = malloc(strlen(s2) + strlen(xpm) + 1);
data/xpat2-1.07/src/X-gfx2.c:412:26:  [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).
	s = malloc(strlen(s2) + strlen(xpm) + 1);
data/xpat2-1.07/src/X-gfx2.c:417: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).
	s = malloc(strlen(LIBDIR) + strlen(xpm) + 2);
data/xpat2-1.07/src/X-gfx2.c:417: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).
	s = malloc(strlen(LIBDIR) + strlen(xpm) + 2);
data/xpat2-1.07/src/X-gfx2.c:422: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).
	s = malloc(strlen(xpm) + 1);
data/xpat2-1.07/src/X-layout.c:32:58:  [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).
	b->w = 2 * button.bx + XTextWidth(button.font, b->text, strlen(b->text));
data/xpat2-1.07/src/X-loadcards.c:35:2:  [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(file) + strlen(LIBDIR) + 8 <= sizeof(fullname)) {
data/xpat2-1.07/src/X-loadcards.c:35: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).
	strlen(file) + strlen(LIBDIR) + 8 <= sizeof(fullname)) {
data/xpat2-1.07/src/X-sound_SUN.c:35:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getc(fp)) != EOF)
data/xpat2-1.07/src/X-widget.c:251: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).
    if (p->xpmdir && strlen(p->xpmdir) >= MAXXPMDIRLEN) {
data/xpat2-1.07/src/XQtCards.cpp:20: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(xpmdir) + strlen(file) + (ext ? strlen(ext) : 3) + 3 > sizeof(buff))
data/xpat2-1.07/src/XQtCards.cpp:20:26:  [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(xpmdir) + strlen(file) + (ext ? strlen(ext) : 3) + 3 > sizeof(buff))
data/xpat2-1.07/src/XQtCards.cpp:20:48:  [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(xpmdir) + strlen(file) + (ext ? strlen(ext) : 3) + 3 > sizeof(buff))
data/xpat2-1.07/src/XQtCards.cpp:319:27:  [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).
    directory = new char [strlen(xpmdir) + 1];
data/xpat2-1.07/src/XQtWindow.cpp:594: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(langdir) + strlen(LIBDIR) + 3 + strlen(helpfilename)
data/xpat2-1.07/src/XQtWindow.cpp:594:27:  [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(langdir) + strlen(LIBDIR) + 3 + strlen(helpfilename)
data/xpat2-1.07/src/XQtWindow.cpp:594:48:  [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(langdir) + strlen(LIBDIR) + 3 + strlen(helpfilename)
data/xpat2-1.07/src/XQtWindow.cpp:610: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(langdir) + strlen(LIBDIR) + 12 <= sizeof(pathname)
data/xpat2-1.07/src/XQtWindow.cpp:610:27:  [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(langdir) + strlen(LIBDIR) + 12 <= sizeof(pathname)
data/xpat2-1.07/src/Xaw-main.c:408:34:  [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).
    XtSetArg(args[0], XtNlabel, (strlen(TXT_NEW_CONFIRM)>strlen(TXT_QUIT_CONFIRM))?TXT_NEW_CONFIRM:TXT_QUIT_CONFIRM);
data/xpat2-1.07/src/Xaw-main.c:408:58:  [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).
    XtSetArg(args[0], XtNlabel, (strlen(TXT_NEW_CONFIRM)>strlen(TXT_QUIT_CONFIRM))?TXT_NEW_CONFIRM:TXT_QUIT_CONFIRM);
data/xpat2-1.07/src/Xlib-buttons.c:35:16:  [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).
	last_message, strlen(last_message));
data/xpat2-1.07/src/Xlib-buttons.c:76:53:  [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).
  	       button.by + button.font->ascent, p->text, strlen(p->text));
data/xpat2-1.07/src/Xlib-buttons.c:87:53:  [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).
  	       button.by + button.font->ascent, p->text, strlen(p->text));
data/xpat2-1.07/src/Xlib-events.c:71: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).
        strlen(confirm.text));
data/xpat2-1.07/src/Xm-about.c:107: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).
  from_value.size	= strlen (from_value.addr)+1;
data/xpat2-1.07/src/Xm-appwin.c:513:23:  [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).
    from_value.size	= strlen (from_value.addr) + 1;
data/xpat2-1.07/src/Xm-args.c:57:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy (progname, string_ptr, sizeof(progname));
data/xpat2-1.07/src/Xv-main.c:111:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(buf, ".");
data/xpat2-1.07/src/commands.c:156:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(buf, " ");
data/xpat2-1.07/src/commands.c:157: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).
    infosub(buf+strlen(buf), game.n_moves, TXT_MOVEBLOCK);
data/xpat2-1.07/src/commands.c:158:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(buf, " ");
data/xpat2-1.07/src/commands.c:160:14:  [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).
	infosub(buf+strlen(buf), (*rules.score)(), TXT_SCOREBLOCK);
data/xpat2-1.07/src/commands.c:161:14:  [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).
	sprintf(buf+strlen(buf), " %d.", rules.maxscore);
data/xpat2-1.07/src/commands.c:163:14:  [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).
	sprintf(buf+strlen(buf), "%s", TXT_NOSCORE);
data/xpat2-1.07/src/commands.c:173:18:  [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).
	    infosub(buf+strlen(buf), rules.param[i]-game.counter[i], rules.paramstring[i]+1);
data/xpat2-1.07/src/commands.c:178:14:  [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).
	infosub(buf+strlen(buf), CARDS_ON_DECK, TXTI_CARDS+1);
data/xpat2-1.07/src/hints.c:189: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).
		p += strlen(p);
data/xpat2-1.07/src/hints.c:193: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).
		p += strlen(p);
data/xpat2-1.07/src/hints.c:205: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 += strlen(p);
data/xpat2-1.07/src/hints.c:210: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 += strlen(p);
data/xpat2-1.07/src/hints.c:215: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 += strlen(p);
data/xpat2-1.07/src/hints.c:219: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).
		p += strlen(p);
data/xpat2-1.07/src/messages.c:172:27:  [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 *p = malloc_(1 + strlen(txt));
data/xpat2-1.07/src/messages.c:193: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(langdir) + strlen(LIBDIR) + 2 > sizeof(buff)) {
data/xpat2-1.07/src/messages.c:193:27:  [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(langdir) + strlen(LIBDIR) + 2 > sizeof(buff)) {
data/xpat2-1.07/src/messages.c:201: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(langdir) < 2)
data/xpat2-1.07/src/messages.c:239: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(filename) + strlen(langdir) + strlen(LIBDIR) + 3 <= sizeof(pathname)) {
data/xpat2-1.07/src/messages.c:239: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).
    if (strlen(filename) + strlen(langdir) + strlen(LIBDIR) + 3 <= sizeof(pathname)) {
data/xpat2-1.07/src/messages.c:239:46:  [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(filename) + strlen(langdir) + strlen(LIBDIR) + 3 <= sizeof(pathname)) {
data/xpat2-1.07/src/messages.c:247: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(filename) + strlen(LIBDIR) + 2 <= sizeof(pathname)) {
data/xpat2-1.07/src/messages.c:247: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).
    if (strlen(filename) + strlen(LIBDIR) + 2 <= sizeof(pathname)) {
data/xpat2-1.07/src/messages.c:388:33:  [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(line, "#x", 2) && strlen(line) < 32) { /* hex number */
data/xpat2-1.07/src/messages.c:396: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(line) < 32 && (p = strchr(line+1, ' '))) {
data/xpat2-1.07/src/messages.c:425: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(str) > 1) {

ANALYSIS SUMMARY:

Hits = 279
Lines analyzed = 21950 in approximately 0.66 seconds (33182 lines/second)
Physical Source Lines of Code (SLOC) = 16710
Hits@level = [0] 235 [1]  62 [2] 132 [3]   4 [4]  81 [5]   0
Hits@level+ = [0+] 514 [1+] 279 [2+] 217 [3+]  85 [4+]  81 [5+]   0
Hits/KSLOC@level+ = [0+] 30.76 [1+] 16.6966 [2+] 12.9862 [3+] 5.08677 [4+] 4.8474 [5+]   0
Symlinks skipped = 3 (--allowlink overrides but see doc for security issue)
Dot directories skipped = 2 (--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.