]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/acl/uuid.c
Memory overflow caused by 'basedir regex', bug #567
[netatalk.git] / libatalk / acl / uuid.c
index c1bc065f8bfab27d316a2db2b5e150a3bd6553a4..ff58c3dd2202f562f3b757bca7053a85cbfdf4ca 100644 (file)
@@ -254,6 +254,7 @@ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
         uid = ntohl(tmp);
         if ((pwd = getpwuid(uid)) == NULL) {
             /* not found, add negative entry to cache */
+            *name = NULL;
             add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
             ret = -1;
         } else {
@@ -263,7 +264,7 @@ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
         }
         LOG(log_debug, logtype_afpd,
             "getnamefromuuid{local}: UUID: %s -> name: %s, type:%s",
-            uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]);
+            uuid_bin2string(uuidp), *name ? *name : "-", uuidtype[(*type) & UUIDTYPESTR_MASK]);
         return ret;
     } else if (memcmp(uuidp, local_group_uuid, 12) == 0) {
         *type = UUID_GROUP;