diff options
author | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-11-10 14:12:46 +0100 |
---|---|---|
committer | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-11-10 14:12:46 +0100 |
commit | cb57e7bcfe7d6a61276b3e796c58684f0a31f3e7 (patch) | |
tree | 404b35a98f30144a7922084aeacaa5b43050516c | |
parent | 688c0d26d0f041fa5beb2ef5d99843a87b962a0e (diff) | |
download | notification-sandbox/mbachmann/response.tar.gz notification-sandbox/mbachmann/response.tar.bz2 notification-sandbox/mbachmann/response.zip |
Fix crash when respc is NULLsandbox/mbachmann/response
Change-Id: I260e4f0b5b67b802fc3c09ff41ed57da9de49ec7
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rwxr-xr-x | src/notification.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/notification.c b/src/notification.c index 0507796..3e12113 100755 --- a/src/notification.c +++ b/src/notification.c @@ -2880,14 +2880,17 @@ EXPORT_API notification_error_e notification_wait_response(notification_h noti, resp = strtok(msg_buffer, "\n"); if (resp) { *respi = atoi(resp); - resp = strtok(NULL, "\n"); - if (resp) - *respc = resp; - else - *respc = NULL; + if (respc != NULL) { + resp = strtok(NULL, "\n"); + if (resp) + *respc = resp; + else + *respc = NULL; + } } else { *respi = 0; - *respc = NULL; + if (respc != NULL) + *respc = NULL; } close(sock_fd); |