Преглед изворни кода

Fix potential NULL dereference in laston_gotshare

Reported by:	cppcheck
Bryan Drewery пре 12 година
родитељ
комит
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])
     where = newsplit(&par);
-  if (!strcmp(where, "-"))
+  if (where && !strcmp(where, "-"))
     where = NULL;
   if (par[0])
     timeval = atol(newsplit(&par));