rdflib.c: fix(?) one more unsafe use of fread()

It isn't 100% clear what is the right thing to do in this particular
case, so this is my best attempt...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2017-04-17 14:22:32 -07:00
parent f20f1878f5
commit 6edeb335f0

View file

@ -370,7 +370,9 @@ int main(int argc, char **argv)
/* check against desired name */
if (!strcmp(buf, argv[3])) {
fread(p = rdbuf, 1, sizeof(rdbuf), fptmp);
if (fread(p = rdbuf, 1, sizeof(rdbuf), fptmp) < 10) {
nasm_fatal(0, "short read on input");
}
l = *(int32_t *)(p + 6);
fseek(fptmp, l, SEEK_CUR);
break;