diff options
author | kris <kris@FreeBSD.org> | 2001-08-23 08:30:29 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-08-23 08:30:29 +0000 |
commit | 17d260fba7b4e19339dbc497cd866d1596586296 (patch) | |
tree | 1455eaf324654d7dafbed6951e7cd868113a332e /sysutils/wmcube/files | |
parent | fa045d00d3d9c74b0ad94804d92003e04f156808 (diff) | |
download | FreeBSD-ports-17d260fba7b4e19339dbc497cd866d1596586296.zip FreeBSD-ports-17d260fba7b4e19339dbc497cd866d1596586296.tar.gz |
Don't buffer overflow when reading the config file.
Obtained from: OpenBSD
Diffstat (limited to 'sysutils/wmcube/files')
-rw-r--r-- | sysutils/wmcube/files/patch-wmcube.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sysutils/wmcube/files/patch-wmcube.c b/sysutils/wmcube/files/patch-wmcube.c new file mode 100644 index 0000000..6f77d7f --- /dev/null +++ b/sysutils/wmcube/files/patch-wmcube.c @@ -0,0 +1,29 @@ +--- wmcube.c.orig Mon Oct 23 22:11:47 2000 ++++ wmcube.c Tue May 15 16:17:02 2001 +@@ -913,7 +926,7 @@ int loadobj(char *filename) { + exit(0); + } + +- fscanf(fp,"%s",tmp); ++ fscanf(fp,"%63s",tmp); + + if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) { + printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n"); +@@ -921,7 +934,7 @@ int loadobj(char *filename) { + exit(0); + } + +- fscanf(fp,"%s",tmp); ++ fscanf(fp,"%63s",tmp); + counter = atoi(tmp); + + while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) { +@@ -938,7 +951,7 @@ int loadobj(char *filename) { + fclose(fp); + exit(0); + } +- fscanf(fp,"%s",tmp); ++ fscanf(fp,"%63s",tmp); + + if (feof(fp)) { + printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n"); |