diff options
Diffstat (limited to 'extra/qhull/qhull-2010.1-overflows.patch')
-rw-r--r-- | extra/qhull/qhull-2010.1-overflows.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/extra/qhull/qhull-2010.1-overflows.patch b/extra/qhull/qhull-2010.1-overflows.patch new file mode 100644 index 000000000..df4aa3da1 --- /dev/null +++ b/extra/qhull/qhull-2010.1-overflows.patch @@ -0,0 +1,50 @@ +From 176c01851026125f574a8223ad49ec58b2b58ec0 Mon Sep 17 00:00:00 2001 +From: Johannes Obermayr <johannesobermayr@gmx.de> +Date: Fri, 23 Jul 2010 20:02:19 +0200 +Subject: [PATCH] Fix some serious compiler warnings causing build breakage on openSUSE. + +--- + src/global.c | 2 +- + src/rboxlib.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/global.c b/src/global.c +index 3c6141a..4c9f56c 100644 +--- a/src/global.c ++++ b/src/global.c +@@ -614,7 +614,7 @@ void qh_initflags(char *command) { + if (command <= &qh qhull_command[0] || command > &qh qhull_command[0] + sizeof(qh qhull_command)) { + if (command != &qh qhull_command[0]) { + *qh qhull_command= '\0'; +- strncat( qh qhull_command, command, sizeof( qh qhull_command)); ++ strncat(qh qhull_command, command, sizeof(qh qhull_command)-strlen(qh qhull_command)-1); + } + while (*s && !isspace(*s)) /* skip program name */ + s++; +diff --git a/src/rboxlib.c b/src/rboxlib.c +index 4f11d22..17d01ac 100644 +--- a/src/rboxlib.c ++++ b/src/rboxlib.c +@@ -124,7 +124,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { + } + + *command= '\0'; +- strncat(command, rbox_command, sizeof(command)); ++ strncat(command, rbox_command, sizeof(command)-strlen(command)-1); + + while (*s && !isspace(*s)) /* skip program name */ + s++; +@@ -346,8 +346,8 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { + } + }else if (israndom) { + seed= (int)time(&timedata); +- sprintf(seedbuf, " t%d", seed); /* appends an extra t, not worth removing */ +- strncat(command, seedbuf, sizeof(command)); ++ printf(seedbuf, " t%d", seed); /* appends an extra t, not worth removing */ ++ strncat(command, seedbuf, sizeof(command)-strlen(command)-1); + t= strstr(command, " t "); + if (t) + strcpy(t+1, t+3); /* remove " t " */ +-- +1.6.1 + |