xkbscan: Copy, rather than assign, file name
authorDaniel Stone <daniel@fooishbar.org>
Wed, 15 Feb 2012 12:54:11 +0000 (12:54 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 15 Feb 2012 16:24:50 +0000 (16:24 +0000)
commit8f01b144126617cb93248210a08749d5ba13dc94
tree4e1de74d242b888bfca5b7d36d177e509e9169f0
parentead9d0cb6203c4582e9233abe86565504316488f
xkbscan: Copy, rather than assign, file name

For some reason, lex decided to reduce a strcpy into an assignment,
leading to entirely justified valgrind warnings about invalid reads,
when scanFile was set to a string which may have only ever lived on the
stack of a now-exited function.

Make it a strdup() instead.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/xkbcomp/misc.c
src/xkbcomp/xkbscan.l