i965: Don't write beyond allocated memory.
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Fri, 13 Nov 2015 11:36:43 +0000 (13:36 +0200)
committerMatt Turner <mattst88@gmail.com>
Fri, 13 Nov 2015 20:06:11 +0000 (12:06 -0800)
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
src/mesa/drivers/dri/i965/brw_eu_validate.c

index eb57962bea30d6ac4b6766bac21574ae27ab6665..2de2ea1babc3ef26004cadd4bc667a275993e5fb 100644 (file)
@@ -39,7 +39,7 @@ cat(struct string *dest, const struct string src)
 {
    dest->str = realloc(dest->str, dest->len + src.len + 1);
    memcpy(dest->str + dest->len, src.str, src.len);
-   dest->str[dest->len + src.len + 1] = '\0';
+   dest->str[dest->len + src.len] = '\0';
    dest->len = dest->len + src.len;
 }
 #define CAT(dest, src) cat(&dest, (struct string){src, strlen(src)})