Skip to content

Commit a8ae2c8

Browse files
Paul Gofmanivyl
authored andcommitted
iphlpapi: Return ERROR_NO_DATA from GetIpNetTable() if no entries are found.
CW-Bug-Id: #20794
1 parent fc25505 commit a8ae2c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dlls/iphlpapi/iphlpapi_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,13 @@ DWORD WINAPI GetIpNetTable( MIB_IPNETTABLE *table, ULONG *size, BOOL sort )
23152315
NULL, 0, &count, 0 );
23162316
if (err) return err;
23172317

2318+
if (!count)
2319+
{
2320+
*size = 0;
2321+
err = ERROR_NO_DATA;
2322+
goto err;
2323+
}
2324+
23182325
needed = FIELD_OFFSET( MIB_IPNETTABLE, table[count] );
23192326

23202327
if (!table || *size < needed)

0 commit comments

Comments
 (0)