/pidgin/main: c1a41f0d1916: log reader: fix a possible NULL-dere...
Tomasz Wasilczyk <[email protected]>
| Newsgroups | gmane.comp.gnome.gaim.cvs |
|---|---|
| Message-ID | <[email protected]> |
Changeset: c1a41f0d191688f39608cd85db3a5025db8f8e2c Author: Tomasz Wasilczyk <[email protected]> Date: 2014-05-07 11:55 +0200 Branch: default URL: https://hg.pidgin.im/pidgin/main/rev/c1a41f0d1916 Description: log reader: fix a possible NULL-dereference. This plugin is really buggy diffstat: libpurple/plugins/log_reader.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diffs (14 lines): diff --git a/libpurple/plugins/log_reader.c b/libpurple/plugins/log_reader.c --- a/libpurple/plugins/log_reader.c +++ b/libpurple/plugins/log_reader.c @@ -1838,7 +1838,9 @@ static GList *qip_logger_list(PurpleLogT c++; /* Find the last '(' character. */ - if ((tmp = strchr(c, '\n')) != NULL) { + if (!c) { + /* do nothing */ + } else if ((tmp = strchr(c, '\n')) != NULL) { while (*tmp && *tmp != '(') --tmp; c = tmp; } else {