Whamcloud - gitweb
LU-4629 libcfs: fix buffer overflow of string buffer
[fs/lustre-release.git] / lustre / include / lustre / lustre_user.h
index e385612..6a828f3 100644 (file)
@@ -498,8 +498,8 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen)
         strncpy(buf, uuid, buflen - 1);
         buf[buflen - 1] = '\0';
         p = strrchr(buf, '-');
-        if (p)
-           *p = '\0';
+       if (p != NULL)
+               *p = '\0';
 }
 
 /* printf display format