From 5e6de5e45a601849af88f08a57e2f0bc3e626f8b Mon Sep 17 00:00:00 2001 From: Kaian Date: Thu, 4 Aug 2016 13:40:33 +0200 Subject: [PATCH] md: avoid buffer overflow when comparing messages. Fixes #134 --- src/curses/ui_msg_diff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/curses/ui_msg_diff.c b/src/curses/ui_msg_diff.c index 74aebcd..f05cda4 100644 --- a/src/curses/ui_msg_diff.c +++ b/src/curses/ui_msg_diff.c @@ -113,7 +113,7 @@ msg_diff_info(ui_t *ui) int msg_diff_line_highlight(const char* payload1, const char* payload2, char *highlight) { - char search[512]; + char search[MAX_SIP_PAYLOAD]; int len, i; // Initialize search terms @@ -156,7 +156,7 @@ msg_diff_draw(ui_t *ui) { // Get panel information msg_diff_info_t *info = msg_diff_info(ui); - char highlight[4086]; + char highlight[MAX_SIP_PAYLOAD]; // Draw first message memset(highlight, 0, sizeof(highlight)); @@ -177,7 +177,7 @@ int msg_diff_draw_message(WINDOW *win, sip_msg_t *msg, char *highlight) { int height, width, line, column, i; - char header[256]; + char header[MAX_SIP_PAYLOAD]; const char * payload = msg_get_payload(msg); // Clear the window