F-9164 - Reject NULL file buffers in no-heap builds

pull/582/head
Aidan Garske 2026-08-21 13:40:29 -07:00
parent 32008fce9f
commit 25bb1672b2
1 changed files with 2 additions and 0 deletions

View File

@ -681,6 +681,8 @@ int loadFile(const char* fname, byte** buf, size_t* bufLen)
*buf = (byte*)XMALLOC(fileSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (*buf == NULL)
ret = MEMORY_E;
#else
ret = MEMORY_E;
#endif
}
else if (*buf != NULL && fileSz > (ssize_t)*bufLen) {