]> arthur.barton.de Git - netatalk.git/blobdiff - bin/ad/ad_ls.c
Fix "ad ls" segfault if requested object is not in an AFP volume
[netatalk.git] / bin / ad / ad_ls.c
index d8362595e4647a7ef54098d4f1711b5b45b5b2ce..b5947e17dd0b48c3fa7d12e477128989372fe38d 100644 (file)
@@ -227,7 +227,7 @@ static void print_flags(char *path, afpvol_t *vol, const struct stat *st)
     if (S_ISDIR(st->st_mode))
         adflags = ADFLAGS_DIR;
 
-    if (vol->vol->v_path == NULL)
+    if (vol->vol == NULL || vol->vol->v_path == NULL)
         return;
 
     ad_init(&ad, vol->vol);