Răsfoiți Sursa

Fix potential NULL dereference in laston_gotshare

Reported by:	cppcheck
Bryan Drewery 12 ani în urmă
părinte
comite
212c8ab29e
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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));