From: Adam Malinowski Date: Tue, 9 Dec 2014 10:36:46 +0000 (+0100) Subject: Fix message buffer usage X-Git-Tag: accepted/tizen/common/20141229.125640^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f43ea0f91624bd797113c499405c316afdced831;p=platform%2Fcore%2Fapi%2Fnotification.git Fix message buffer usage notification_wait_response uses uninitialized msg_buffer which causes unexpected behaviour in subsequent calls to this function. Problem occurs when timeout happens. In such case message_buffer is not filled by read function and contains random data, mostly data received in previous call to the function. Change-Id: Ibce7e63b212d30022da277ba62cbb789df2503fd --- diff --git a/src/notification.c b/src/notification.c index 17b9985..799d12f 100755 --- a/src/notification.c +++ b/src/notification.c @@ -2827,7 +2827,9 @@ EXPORT_API notification_error_e notification_wait_response(notification_h noti, struct timeval timeout_tv; char *resp; - /* a response packet *must* have an execute option TYPE_RESPONDING + memset(msg_buffer, 0, sizeof(msg_buffer)); + + /* a response packet *must* have an execute option TYPE_RESPONDING with an associated bundle. If its bundle does not already contain a "tid" hint (which complex applications such as xwalk may overwrite), we will