From 6bf09a100287d47f7f33d85347f25e9d092cb528 Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Wed, 1 Aug 2012 12:56:56 +0400 Subject: [PATCH] src/hw/maru_touchscreen.c: fix wrong buffer size to memset To clear buffer usb_touchscreen_handle_data() function called a memset function with length longer then actual length of buffer, it resulted in USB packet corruption. Signed-off-by: Igor Mitsyanko --- tizen/src/hw/maru_touchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tizen/src/hw/maru_touchscreen.c b/tizen/src/hw/maru_touchscreen.c index 151a924484..0e9a2e2a4b 100644 --- a/tizen/src/hw/maru_touchscreen.c +++ b/tizen/src/hw/maru_touchscreen.c @@ -186,7 +186,7 @@ static int usb_touchscreen_handle_data(USBDevice *dev, USBPacket *p) pthread_mutex_unlock(&event_mutex); - memset(buf, 0, sizeof(buf) * (p->iov.size - 1)); + memset(buf, 0, sizeof(buf)); ret = usb_touchscreen_poll(s, buf, p->iov.size); //write event to packet usb_packet_copy(p, buf, ret); break; -- 2.34.1