[pacman-dev] [PATCH] pacsort: test string is not NULL before strlen
Allan McRae
allan at archlinux.org
Tue Feb 24 15:02:20 UTC 2015
Signed-off-by: Allan McRae <allan at 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
More information about the pacman-dev
mailing list