Skip to content

Fix overflow on XmbLookupString buffer

Alan Coopersmith requested to merge alanc/xev:patch into master

The returned nmbbytes value is the length we need the buffer to be, but the current size is only bsize. We can't store a NUL at buf[nmbbytes] before the realloc, so only do this when the buffer is sized properly.

Signed-off-by: Mikael Magnusson <>
[ Moved string termination out of the loop]
Signed-off-by: Ismael Luceno <>
Signed-off-by: Alan Coopersmith <>
Edited by Alan Coopersmith

Merge request reports