add bounds checking at storage buffer
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Wed, 23 Feb 2011 07:42:54 +0000 (16:42 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Wed, 23 Feb 2011 07:42:54 +0000 (16:42 +0900)
src/xcnphandler.c

index 2b854ff..3f0fcf5 100755 (executable)
@@ -115,6 +115,8 @@ int add_to_storage_buffer(void *data, char *src, int len)
 
        if (len <= 0)
                return -1;
+       if (len > HISTORY_QUEUE_ITEM_SIZE)
+               len = HISTORY_QUEUE_ITEM_SIZE;
 
        if (g_lastest_content != NULL)
                free(g_lastest_content);