]> arthur.barton.de Git - netatalk.git/commitdiff
Check for empty EA slots and fix log messag missing parameter
authorFrank Lahm <franklahm@googlemail.com>
Thu, 13 Oct 2011 09:59:38 +0000 (11:59 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 13 Oct 2011 09:59:38 +0000 (11:59 +0200)
libatalk/vfs/ea.c

index fa3a010926c898ff1a1688d0e631e5cf13f64f47..abe266fef978574b0140ef01773b1b6be3927df7 100644 (file)
@@ -514,13 +514,15 @@ static int ea_delentry(struct ea * restrict ea, const char * restrict attruname)
     unsigned int count = 0;
 
     if (ea->ea_count == 0) {
-        LOG(log_error, logtype_afpd, "ea_delentry('%s'): illegal ea_count of 0 on deletion");
+        LOG(log_error, logtype_afpd, "ea_delentry('%s'): illegal ea_count of 0 on deletion",
+            attruname);
         return -1;
     }
 
     while (count < ea->ea_count) {
         /* search matching EA */
-        if (strcmp(attruname, (*ea->ea_entries)[count].ea_name) == 0) {
+        if ((*ea->ea_entries)[count].ea_name &&
+            strcmp(attruname, (*ea->ea_entries)[count].ea_name) == 0) {
             free((*ea->ea_entries)[count].ea_name);
             (*ea->ea_entries)[count].ea_name = NULL;