Package: boinc / 7.14.2+dfsg-3

lib_cppcheck.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: this patch adds a checks for enough free memory, and exits in case of not enough.
--- a/lib/unix_util.cpp
+++ b/lib/unix_util.cpp
@@ -80,7 +80,13 @@
             }
             if (i!=envstrings.end()) {
                 // we allocated this string.  Reallocate it.
+		char *b=buf;
                 buf=(char *)realloc(buf,strlen(name)+strlen(value)+2);
+		if (!buf) {
+		    free(b);
+		    errno=ENOMEM;
+		    return -1;
+		}
                 *i=buf;
             } else {
                 // someone else allocated the string.  Allocate new memory.