Do not attempt to search for database records of length 0.
[citadel.git] / citadel / user_ops.c
index 0dc5ae3276b4909587f673041368b5f53cc2fc8a..473e83a80a8783c62ba938653a5e0c91599fbc5e 100644 (file)
@@ -84,9 +84,12 @@ int CtdlGetUser(struct ctdluser *usbuf, char *name)
        }
 
        makeuserkey(usernamekey, name);
+       if (IsEmptyStr(usernamekey)) {
+               return(1);      // empty user name
+       }
        cdbus = cdb_fetch(CDB_USERS, usernamekey, strlen(usernamekey));
 
-       if (cdbus == NULL) {    /* user not found */
+       if (cdbus == NULL) {    // user not found
                return(1);
        }
        if (usbuf != NULL) {