pacsort: test string is not NULL before strlen
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
d9b5cb238d
commit
9f1c5f0251
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue