From bb0911e2c98ea91f4cda16ed99804ff40d82257c Mon Sep 17 00:00:00 2001 From: smlng Date: Tue, 21 Jun 2016 11:31:02 +0200 Subject: [PATCH] fix possible memory corruption, if bird_response to long --- bird-rtrlib-cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bird-rtrlib-cli.c b/bird-rtrlib-cli.c index 81aff01..98a0f7c 100644 --- a/bird-rtrlib-cli.c +++ b/bird-rtrlib-cli.c @@ -165,7 +165,7 @@ static void pfx_update_callback(struct pfx_table *table, write(bird_socket, bird_command, strlen(bird_command)); // Fetch the answer and log. - bird_response[read(bird_socket, bird_response, sizeof bird_response)] = 0; + bird_response[read(bird_socket, bird_response, sizeof(bird_response)-1)] = 0; syslog(LOG_INFO, "From BIRD: %s", bird_response); }