From fc35de9a43f65191552d0fb9f958b3245f6c017c Mon Sep 17 00:00:00 2001 From: GangHeok Kim Date: Mon, 15 Jul 2013 13:06:08 +0900 Subject: [PATCH] Fixed prevent defects Change-Id: Idde4e3840cbc429c21f1fb303ec04677e98082ac --- debian/changelog | 8 ++++++++ src/pt_service.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d909b0f..d279a31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +print-service (1.2.9-1) unstable; urgency=low + + * Fixed prevent defects + * Git: apps/home/print-service + * Tag: print-service_1.2.9-1 + + -- GangHeok Kim Mon, 15 Jul 2013 13:04:59 +0900 + print-service (1.2.8-1) unstable; urgency=low * Added pt_set_print_option_page_range() diff --git a/src/pt_service.c b/src/pt_service.c index 2434609..5057a3f 100644 --- a/src/pt_service.c +++ b/src/pt_service.c @@ -235,10 +235,10 @@ static gboolean __pt_process_hotplug_event(GIOChannel *source, GIOCondition cond { pt_info_t *info = (pt_info_t *)data; int read_len = -1; - char buf[MAX_MSG_LEN] = {0,}; + char buf[MAX_MSG_LEN+1] = {0,}; - memset(buf, '\0', MAX_MSG_LEN); - read_len = recv(info->ueventsocket, buf, sizeof(buf)-1, 0); + read_len = recv(info->ueventsocket, buf, MAX_MSG_LEN, 0); + buf[MAX_MSG_LEN] = '\0'; if (read_len == -1) { return FALSE; -- 2.7.4