From: Vinson Lee Date: Sun, 3 Jan 2010 10:38:22 +0000 (-0800) Subject: progs/vp: Ensure null-terminated byte string. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1da47ac20e676e05c1b0b66c2c07265836f4c7eb;p=mesa.git progs/vp: Ensure null-terminated byte string. --- diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 29cd027b00c..09236c296f7 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -96,7 +96,8 @@ static void Init( void ) exit(1); } - sz = (GLuint) fread(buf, 1, sizeof(buf), f); + sz = (GLuint) fread(buf, 1, sizeof(buf) - 1, f); + buf[sizeof(buf) - 1] = '\0'; if (!feof(f)) { fprintf(stderr, "file too long\n"); fclose(f);