mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-28 06:10:53 +08:00
test-generated-code2.c: Don't call memcmp with a NULL pointer
This commit is contained in:
parent
e2d45cbe84
commit
8debedbc3c
@ -96,6 +96,8 @@ binary_data_equals (ProtobufCBinaryData a, ProtobufCBinaryData b)
|
|||||||
{
|
{
|
||||||
if (a.len != b.len)
|
if (a.len != b.len)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (a.len == 0 && b.len == 0)
|
||||||
|
return 1;
|
||||||
return memcmp (a.data, b.data, a.len) == 0;
|
return memcmp (a.data, b.data, a.len) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user