diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-08-05 13:25:22 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-08-05 13:25:22 +0100 |
commit | 856daf2443ee60f6b56e469e3a7f6600e599aaee (patch) | |
tree | 4543fe3d2040a8de84bcb7175ec07f268844dd48 | |
parent | 85f2066c9b502ac647e324de289b185078d7be25 (diff) |
Fix buffer overflow in xev.c
If initially buffer is smaller size returned is too big, do not
use to terminate the string.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | xev.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -101,13 +101,13 @@ do_KeyPress (XEvent *eventp) if (e->type == KeyPress && xic) { do { nmbbytes = XmbLookupString (xic, e, buf, bsize - 1, &ks, &status); - buf[nmbbytes] = '\0'; if (status == XBufferOverflow) { bsize = nmbbytes + 1; buf = realloc (buf, bsize); } } while (status == XBufferOverflow); + buf[nmbbytes] = '\0'; } if (ks == NoSymbol) |