From 639675c07e79ee20d5a16280e164980fa31a4545 Mon Sep 17 00:00:00 2001 From: Steveice10 Date: Mon, 9 Jan 2017 16:12:52 -0800 Subject: [PATCH] Include space for null terminator in received URL payload. --- source/ui/section/remoteinstall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ui/section/remoteinstall.c b/source/ui/section/remoteinstall.c index be95ff0..596a577 100644 --- a/source/ui/section/remoteinstall.c +++ b/source/ui/section/remoteinstall.c @@ -157,7 +157,7 @@ static void remoteinstall_network_update(ui_view* view, void* data, float* progr return; } - char* urls = (char*) calloc(size, sizeof(char)); + char* urls = (char*) calloc(size + 1, sizeof(char)); if(urls == NULL) { error_display(NULL, NULL, "Failed to allocate URL buffer."); @@ -485,4 +485,4 @@ static void remoteinstall_update(ui_view* view, void* data, linked_list* items, void remoteinstall_open() { list_display("Remote Install", "A: Select, B: Return", NULL, remoteinstall_update, NULL); -} \ No newline at end of file +}