瀏覽代碼

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));