mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Buffer overflow fixes from Steve Kemp and Ulf Harnhammar.
Obtained from: Debian
This commit is contained in:
parent
c2ec7ecdb2
commit
646f99fca7
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=126157
4 changed files with 50 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= xshisen
|
||||
PORTVERSION= 1.36
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= games
|
||||
MASTER_SITES= http://www.techfirm.co.jp/~masaoki/
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
--- main.C.orig Sun Dec 12 14:34:28 1999
|
||||
+++ main.C Sun Dec 12 14:39:33 1999
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- main.C.orig
|
||||
+++ main.C
|
||||
@@ -44,53 +44,53 @@
|
||||
|
||||
static XtResource gres[] = {
|
||||
|
@ -78,3 +81,15 @@
|
|||
};
|
||||
GlobRes globRes;
|
||||
|
||||
@@ -194,9 +194,9 @@
|
||||
char buffer[100], *p;
|
||||
char *(*codeconv)(const char*);
|
||||
|
||||
- strcpy(buffer, operation);
|
||||
+ strlcpy(buffer, operation, sizeof(buffer));
|
||||
if (strchr(buffer, '-') == NULL) {
|
||||
- strcat(buffer, "-" KANJICODE);
|
||||
+ strlcat(buffer, "-" KANJICODE, sizeof(buffer));
|
||||
}
|
||||
if (strncasecmp(buffer, "jis-euc", 7) == 0)
|
||||
codeconv = jis_to_euc;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
--- score.C.orig Tue Jan 23 00:52:09 1996
|
||||
+++ score.C Sat Aug 26 05:10:09 2000
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- score.C.orig
|
||||
+++ score.C
|
||||
@@ -4,31 +4,31 @@
|
||||
|
||||
XtResource Score::resources[] = {
|
||||
|
@ -58,6 +61,19 @@
|
|||
}
|
||||
|
||||
void
|
||||
@@ -371,10 +377,10 @@
|
||||
s1 = scoreToRegister / 1000;
|
||||
ms_to_hms(scoreToRegister, h, m, s);
|
||||
pw = getpwuid(getuid());
|
||||
- strcpy(gecos, pw->pw_gecos);
|
||||
+ strlcpy(gecos, pw->pw_gecos, sizeof(gecos));
|
||||
if ((po = strchr(gecos, ',')) != NULL)
|
||||
*po = 0;
|
||||
- sprintf(namebuf, "%-8.8s (%s)", pw->pw_name, gecos);
|
||||
+ snprintf(namebuf, sizeof(namebuf), "%-8.8s (%s)", pw->pw_name, gecos);
|
||||
sprintf(myname, "%-28.28s", namebuf);
|
||||
// Always read the latest high score
|
||||
readfile();
|
||||
@@ -414,7 +420,7 @@
|
||||
strcpy(rec[inspos].name, myname);
|
||||
time(&t);
|
||||
|
|
14
games/xshisen/files/patch-readxpm.C
Normal file
14
games/xshisen/files/patch-readxpm.C
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
$FreeBSD$
|
||||
|
||||
--- readxpm.C.orig
|
||||
+++ readxpm.C
|
||||
@@ -12,7 +12,7 @@
|
||||
char buffer[1024];
|
||||
|
||||
for(int i=0; i<PKIND; i++) {
|
||||
- sprintf(buffer, "%s/%s.xpm", directory, files[i]);
|
||||
+ snprintf(buffer, sizeof(buffer), "%s/%s.xpm", directory, files[i]);
|
||||
Mp[i].ReadFile(w, buffer, i, globRes.colorCloseness);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue