diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-03-18 18:31:08 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-03-18 18:31:08 +0000 |
commit | 219ef4e86f05e7a473e399c5188efdb7f16f31f1 (patch) | |
tree | 1d6cd296d93c99706a6e86ebafda6d5ab7b4bd79 | |
parent | 950d308b3230e7e89d307fd95abb983e44987665 (diff) |
Avoid potential underflow if read() returns -1. Coverity CID 414XORG-7_0_99_901
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | xconsole.c | 20 |
2 files changed, 16 insertions, 10 deletions
@@ -1,3 +1,9 @@ +2006-03-18 Matthieu Herrb <matthieu.herrb@laas.fr> + + * xconsole.c: + Avoid potential underflow if read() returns -1. + Coverity CID 414 + 2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> * configure.ac: @@ -516,17 +516,17 @@ inputReady(XtPointer w, int *source, XtInputId *id) { OpenConsole(); } - - } - Notify (); - buffer[n] = '\0'; - if (app_resources.stripNonprint) - { - stripNonprint (buffer); - n = strlen (buffer); + } else { + Notify(); + buffer[n] = '\0'; + if (app_resources.stripNonprint) + { + stripNonprint (buffer); + n = strlen (buffer); + } + + TextAppend ((Widget) text, buffer, n); } - - TextAppend ((Widget) text, buffer, n); } static Boolean |