From: Matt Turner Date: Mon, 29 Jun 2015 22:05:19 +0000 (-0700) Subject: ralloc: Set *start in ralloc_vasprintf_rewrite_tail() if str is NULL. X-Git-Tag: upstream/17.1.0~14691 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=238877207eda2d7513cb0d2b415f8fc7ac821d0e;p=platform%2Fupstream%2Fmesa.git ralloc: Set *start in ralloc_vasprintf_rewrite_tail() if str is NULL. We were leaving it undefined, even though we were writing a string to *str. Reviewed-by: Kenneth Graunke --- diff --git a/src/util/ralloc.c b/src/util/ralloc.c index e07fce7..bb4cf96 100644 --- a/src/util/ralloc.c +++ b/src/util/ralloc.c @@ -499,6 +499,7 @@ ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt, if (unlikely(*str == NULL)) { // Assuming a NULL context is probably bad, but it's expected behavior. *str = ralloc_vasprintf(NULL, fmt, args); + *start = strlen(*str); return true; }