mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
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:
parent
f20f1878f5
commit
6edeb335f0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user