Skip to content

Commit 1111e0a

Browse files
committed
devprv handle valid empty strings
1 parent e233cee commit 1111e0a

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

SystemInformer/devprv.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,9 @@ BOOLEAN PhpGetDevicePropertyString(
871871
}
872872

873873
if (requiredLength < sizeof(UNICODE_NULL))
874-
{
875-
result = FALSE;
876-
goto Exit;
877-
}
878-
879-
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
874+
*String = PhReferenceEmptyString();
875+
else
876+
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
880877

881878
Exit:
882879

@@ -937,12 +934,9 @@ BOOLEAN PhpGetDeviceInterfacePropertyString(
937934
}
938935

939936
if (requiredLength < sizeof(UNICODE_NULL))
940-
{
941-
result = FALSE;
942-
goto Exit;
943-
}
944-
945-
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
937+
*String = PhReferenceEmptyString();
938+
else
939+
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
946940

947941
Exit:
948942

@@ -1001,12 +995,9 @@ BOOLEAN PhpGetClassPropertyString(
1001995
}
1002996

1003997
if (requiredLength < sizeof(UNICODE_NULL))
1004-
{
1005-
result = FALSE;
1006-
goto Exit;
1007-
}
1008-
1009-
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
998+
*String = PhReferenceEmptyString();
999+
else
1000+
*String = PhCreateStringEx(buffer, requiredLength - sizeof(UNICODE_NULL));
10101001

10111002
Exit:
10121003

0 commit comments

Comments
 (0)