tests: Don't call memcmp() with NULL arguments
You're not supposed to pass NULL to memcmp(), and some sanitizers complain about it, even when the length is zero. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
c12b2b0c20
commit
57f7f9e7bc
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ void check_property(void *fdt, int nodeoffset, const char *name,
|
||||||
if (proplen != len)
|
if (proplen != len)
|
||||||
FAIL("Size mismatch on property \"%s\": %d insead of %d",
|
FAIL("Size mismatch on property \"%s\": %d insead of %d",
|
||||||
name, proplen, len);
|
name, proplen, len);
|
||||||
if (memcmp(val, prop->data, len) != 0)
|
if (len && memcmp(val, prop->data, len) != 0)
|
||||||
FAIL("Data mismatch on property \"%s\"", name);
|
FAIL("Data mismatch on property \"%s\"", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ const void *check_getprop(void *fdt, int nodeoffset, const char *name,
|
||||||
if (proplen != len)
|
if (proplen != len)
|
||||||
FAIL("Size mismatch on property \"%s\": %d insead of %d",
|
FAIL("Size mismatch on property \"%s\": %d insead of %d",
|
||||||
name, proplen, len);
|
name, proplen, len);
|
||||||
if (memcmp(val, propval, len) != 0)
|
if (len && memcmp(val, propval, len) != 0)
|
||||||
FAIL("Data mismatch on property \"%s\"", name);
|
FAIL("Data mismatch on property \"%s\"", name);
|
||||||
|
|
||||||
return propval;
|
return propval;
|
||||||
|
|
Loading…
Reference in a new issue