mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
progs/vp: Ensure null-terminated byte string.
This commit is contained in:
parent
c9c6e9a39e
commit
1da47ac20e
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue