From 9f1c5f0251c202ad504f03464da23a5050914157 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 25 Feb 2015 01:01:49 +1000 Subject: pacsort: test string is not NULL before strlen Signed-off-by: Allan McRae --- src/util/pacsort.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 02b9084b..d864fdb9 100644 --- a/src/util/pacsort.c +++ b/src/util/pacsort.c @@ -399,9 +399,13 @@ static int vercmp(const void *p1, const void *p2) static char escape_char(const char *string) { + if(!string) { + return -1; + } + const size_t len = strlen(string); - if(!string || len > 2) { + if(len > 2) { return -1; } -- cgit v1.2.3-70-g09d2