From 4170970c85da252ee2061f81520581fb71f5e149 Mon Sep 17 00:00:00 2001 From: Aaron Marcher Date: Mon, 15 Aug 2016 13:08:34 +0200 Subject: fixed strcat null possibility in main() --- slstatus.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'slstatus.c') diff --git a/slstatus.c b/slstatus.c index d993eca..b74faa6 100644 --- a/slstatus.c +++ b/slstatus.c @@ -689,6 +689,10 @@ main(void) argument = args[i]; char *res = argument.func(argument.args); char *element = smprintf(argument.format, res); + if (element == NULL) { + element = smprintf("n/a"); + fprintf(stderr, "Failed to format output."); + } strcat(status_string, element); free(res); free(element); -- cgit v1.2.3