Fix unchecked malloc result in read_reparse_data

If malloc fails, indata would be NULL and passed directly to
DeviceIoControl, causing undefined behavior.
This commit is contained in:
Tim Kientzle committed 2026-05-16 10:02:30 -07:00
1 parent 89a6d760c1
commit 589004793a
1 file changed
+2
+2
View File
@@ -358,6 +358,8 @@ la_linkname_from_handle(HANDLE h, wchar_t **linkname, int *linktype)
}
indata = malloc(MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
if (indata == NULL)
return (-1);
ret = DeviceIoControl(h, FSCTL_GET_REPARSE_POINT, NULL, 0, indata,
1024, &inbytes, NULL);
if (ret == 0) {