Просмотр исходного кода

Fix potential NULL dereference in laston_gotshare

Reported by:	cppcheck
Bryan Drewery 12 лет назад
Родитель
Сommit
212c8ab29e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/userent.c

+ 1 - 1
src/userent.c

@@ -742,7 +742,7 @@ static bool laston_gotshare(struct userrec *u, struct user_entry *e, char *par,
 
 
   if (par[0])
   if (par[0])
     where = newsplit(&par);
     where = newsplit(&par);
-  if (!strcmp(where, "-"))
+  if (where && !strcmp(where, "-"))
     where = NULL;
     where = NULL;
   if (par[0])
   if (par[0])
     timeval = atol(newsplit(&par));
     timeval = atol(newsplit(&par));