[UBSAN] deltas: Don't call memset(NULL, NULL, 0) with no xattrs

This is actually fine in practice, but it triggers this
`-fsanitize=undefined` warning I saw in the test suite log:

```
src/libostree/ostree-repo-static-delta-compilation.c:160:10: runtime error: null pointer passed as argument 1, which is declared to never be null
```

Closes: #584
Approved by: jlebon
This commit is contained in:
Colin Walters 2016-11-17 13:48:58 -05:00 committed by Atomic Bot
parent 0ee9e221be
commit b5c4e6d99a
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ xattr_chunk_equals (const void *one, const void *two)
if (l1 != l2)
return FALSE;
if (l1 == 0)
return l2 == 0;
return memcmp (g_variant_get_data (v1), g_variant_get_data (v2), l1) == 0;
}