diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-04-07 01:23:50 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-04-07 01:23:50 +0000 |
commit | bda292120fc97f890c1f58a31177c0f7c0bfa048 (patch) | |
tree | 3da5257221023ad7df908c37d8a6849869ceafa5 | |
parent | 536628bb4bcb0a0d749e0c01412a5eb5d6d24063 (diff) |
Coverity #985: Avoid segfault on malloc failure.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | GL/glx/single2.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2006-04-06 Adam Jackson <ajax@freedesktop.org> + * GL/glx/single2.c: + Coverity #985: Avoid segfault on malloc failure. + +2006-04-06 Adam Jackson <ajax@freedesktop.org> + * hw/dmx/dmxextension.c: Coverity #1037: Sanity check idx before use. diff --git a/GL/glx/single2.c b/GL/glx/single2.c index 383c8e763..efc7220f3 100644 --- a/GL/glx/single2.c +++ b/GL/glx/single2.c @@ -270,12 +270,12 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) if (clen > slen) { combo_string = (char *) xalloc(slen + 2); s1 = (char *) xalloc(slen + 2); - strcpy(s1, sext_string); + if (s1) strcpy(s1, sext_string); s2 = cext_string; } else { combo_string = (char *) xalloc(clen + 2); s1 = (char *) xalloc(clen + 2); - strcpy(s1, cext_string); + if (s1) strcpy(s1, cext_string); s2 = sext_string; } if (!combo_string || !s1) { |