Files
xen/tools/tests
Edwin Török bdd49cc2f6 tools/tests/x86_emulator: avoid passing NULL to memcpy
Fixes this `-fsanitize=undefined` error:
```
test_x86_emulator.c:614:12: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior test_x86_emulator.c:614:12
```

Although this is more of a grey area: I don't see anything in the
standard that'd forbid calling `memcpy` with NULL and 0, but `glibc`
does specify it as non-null, which allows the compiler to make
optimizations assuming it never is NULL, so this is undefined behaviour
only on glibc.
Best to avoid the potential undefined behaviour though.

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-03-04 08:26:11 +01:00
..
2025-12-17 17:35:24 +00:00
2025-10-09 11:09:25 +02:00
2026-03-04 08:21:28 +01:00
2025-12-17 17:35:24 +00:00