From eafb6260c113e7dbc6966fbb6f1524bc77f4527e Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Tue, 25 Oct 2005 19:12:29 +0000 Subject: [PATCH] Fixed crashing mbtask on receiving empty coded loglines --- ChangeLog | 3 +++ lib/clcomm.c | 4 ++-- mbtask/taskutil.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 594aa133..0c108c64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ v0.81.4 23-Oct-2005 libmbse.a: Added some forgotten client/server encoding. + mbtask: + Fixed crashing mbtask on receiving empty coded loglines. + v0.81.3 17-Oct-2005 - 23-Oct-2005 diff --git a/lib/clcomm.c b/lib/clcomm.c index 1fe4ca4b..cc259101 100644 --- a/lib/clcomm.c +++ b/lib/clcomm.c @@ -559,8 +559,8 @@ char *cldecode(char *s) char *p, *q; int i; - if (s == NULL) { - return NULL; + if ((s == NULL) || (! strlen(s))) { + return (char *)""; } for (p = s, q = s; *p; p++) { diff --git a/mbtask/taskutil.c b/mbtask/taskutil.c index 266b9520..fdd9acc0 100644 --- a/mbtask/taskutil.c +++ b/mbtask/taskutil.c @@ -667,8 +667,8 @@ char *cldecode(char *s) char *p, *q; int i; - if (s == NULL) { - return NULL; + if ((s == NULL) || (! strlen(s))) { + return (char *)""; } for (p = s, q = s; *p; p++) {