summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-01-03 02:38:22 -0800
committerVinson Lee <vlee@vmware.com>2010-01-03 02:38:22 -0800
commit1da47ac20e676e05c1b0b66c2c07265836f4c7eb (patch)
tree369aebc63931c1c3507e49ed6c7c6ef1fdaed86f /progs
parentc9c6e9a39e3d38cfc05772667c759b82df8f0fff (diff)
progs/vp: Ensure null-terminated byte string.
Diffstat (limited to 'progs')
-rw-r--r--progs/vp/vp-tris.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 29cd027b00..09236c296f 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);