Skip to content

Commit 651a8e2

Browse files
committed
Avoid uninitialized memory
As reported by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16856
1 parent 69f7141 commit 651a8e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/mat4.c

+2
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,8 @@ Mat_VarReadNextInfo4(mat_t *mat)
917917
if ( tmp != readresult ) {
918918
Mat_VarFree(matvar);
919919
return NULL;
920+
} else {
921+
matvar->name[tmp - 1] = '\0';
920922
}
921923

922924
matvar->internal->datapos = ftell((FILE*)mat->fp);

0 commit comments

Comments
 (0)