1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
From: Steve Kemp <skx@debian.org>
Date: Fri, 3 Oct 2003 16:17:58 +0100
Subject: xshisen allows local user to gain GID(games);
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;bug=213957
Bug-Debian: http://bugs.debian.org/213957
---
main.C | 2 +-
readxpm.C | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.C b/main.C
index afa888e..2669f6f 100644
--- a/main.C
+++ b/main.C
@@ -210,7 +210,7 @@ kanjiconvert(const char *operation)
char buffer[100], *p;
char *(*codeconv)(const char*);
- strcpy(buffer, operation);
+ strncpy(buffer, operation,sizeof(buffer)-1);
if (strchr(buffer, '-') == NULL) {
strcat(buffer, "-" KANJICODE);
}
diff --git a/readxpm.C b/readxpm.C
index ba8305b..5737cf4 100644
--- a/readxpm.C
+++ b/readxpm.C
@@ -12,7 +12,7 @@ InitGlobalMahjong(Widget w, const char *directory, const char *subdir)
char buffer[1024];
for(int i=0; i<PKIND; i++) {
- sprintf(buffer, "%s/%s/%s.xpm", directory, subdir, files[i]);
+ snprintf(buffer,sizeof(buffer)-1, "%s/%s/%s.xpm", directory, subdir, files[i]);
Mp[i].ReadFile(w, buffer, i, globRes.colorCloseness);
}
}
|