diff options
author | naddy <naddy@FreeBSD.org> | 2005-01-12 05:31:48 +0800 |
---|---|---|
committer | naddy <naddy@FreeBSD.org> | 2005-01-12 05:31:48 +0800 |
commit | 8e14d437226ffd7f77e6b78c7f22b9a2e9720888 (patch) | |
tree | cb5448dbfa030fa0ec5e37aa2b98cca1859fa2b6 | |
parent | 548e49f269f4e0f4ff10faf5f1eaee8002e35cbb (diff) | |
download | freebsd-ports-graphics-8e14d437226ffd7f77e6b78c7f22b9a2e9720888.tar.gz freebsd-ports-graphics-8e14d437226ffd7f77e6b78c7f22b9a2e9720888.tar.zst freebsd-ports-graphics-8e14d437226ffd7f77e6b78c7f22b9a2e9720888.zip |
Buffer overflow fixes from Steve Kemp and Ulf Harnhammar.
Obtained from: Debian
-rw-r--r-- | games/xshisen/Makefile | 1 | ||||
-rw-r--r-- | games/xshisen/files/patch-ad | 19 | ||||
-rw-r--r-- | games/xshisen/files/patch-af | 20 | ||||
-rw-r--r-- | games/xshisen/files/patch-readxpm.C | 14 |
4 files changed, 50 insertions, 4 deletions
diff --git a/games/xshisen/Makefile b/games/xshisen/Makefile index 3c577b099db..814b1794d0f 100644 --- a/games/xshisen/Makefile +++ b/games/xshisen/Makefile @@ -7,6 +7,7 @@ PORTNAME= xshisen PORTVERSION= 1.36 +PORTREVISION= 1 CATEGORIES= games MASTER_SITES= http://www.techfirm.co.jp/~masaoki/ diff --git a/games/xshisen/files/patch-ad b/games/xshisen/files/patch-ad index d96935d187e..c7d1cbea043 100644 --- a/games/xshisen/files/patch-ad +++ b/games/xshisen/files/patch-ad @@ -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; diff --git a/games/xshisen/files/patch-af b/games/xshisen/files/patch-af index b324160ddc9..5b4a63af10c 100644 --- a/games/xshisen/files/patch-af +++ b/games/xshisen/files/patch-af @@ -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); diff --git a/games/xshisen/files/patch-readxpm.C b/games/xshisen/files/patch-readxpm.C new file mode 100644 index 00000000000..44bb429475d --- /dev/null +++ b/games/xshisen/files/patch-readxpm.C @@ -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); + } + } |