[FFmpeg-cvslog] cmdutils_read_file: increment *size after writing the trailing \0

Janne Grunau git at videolan.org
Wed Oct 10 13:24:00 CEST 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue Oct  9 17:55:32 2012 +0200| [b94e4acb4874843e914fd3cb8e089aff0756bb4a] | committer: Janne Grunau

cmdutils_read_file: increment *size after writing the trailing \0

Fixes CID732166.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b94e4acb4874843e914fd3cb8e089aff0756bb4a
---

 cmdutils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmdutils.c b/cmdutils.c
index 3ae48e4..ac971df 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);



More information about the ffmpeg-cvslog mailing list