From b94e4acb4874843e914fd3cb8e089aff0756bb4a Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 9 Oct 2012 17:55:32 +0200 Subject: [PATCH] cmdutils_read_file: increment *size after writing the trailing \0 Fixes CID732166. --- cmdutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdutils.c b/cmdutils.c index 3ae48e4863..ac971df20a 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1061,7 +1061,7 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size) ret = AVERROR_EOF; } else { ret = 0; - (*bufptr)[*size++] = '\0'; + (*bufptr)[(*size)++] = '\0'; } fclose(f);