Skip to content

gscanner: Avoid undefined behaviour copying between union members

It’s technically undefined behaviour in C to copy between two potentially-overlapping regions of memory (just like it is when calling memcpy()). This can easily happen with union members; and the ones in GScanner in particular.

Fix that by copying through an intermediate variable.

Coverity CID: #1427317, 1427340

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Merge request reports