[pacman-dev] [PATCH] pacsort: test string is not NULL before strlen
24 Feb
2015
24 Feb
'15
4:02 p.m.
Signed-off-by: Allan McRae <allan@archlinux.org> --- src/util/pacsort.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 02b9084..d864fdb 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; } -- 2.3.0
3573
Age (days ago)
3573
Last active (days ago)
0 comments
1 participants
participants (1)
-
Allan McRae