OSDN Git Service

Added check for label entry.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 17 Sep 2009 19:16:25 +0000 (19:16 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Thu, 17 Sep 2009 19:16:25 +0000 (19:16 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@6 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/lookup.c

index e5607d4..231d2a5 100644 (file)
@@ -44,6 +44,7 @@ int exfat_readdir(struct exfat* ef, struct exfat_node* node,
        const struct exfat_file_name* file_name;
        const struct exfat_upcase* upcase;
        const struct exfat_bitmap* bitmap;
+       const struct exfat_label* label;
        uint8_t continuations = 0;
        le16_t* namep = NULL;
 
@@ -176,6 +177,15 @@ int exfat_readdir(struct exfat* ef, struct exfat_node* node,
                                return -EIO;
                        }
                        break;
+
+               case EXFAT_ENTRY_LABEL:
+                       label = (const struct exfat_label*) entry;
+                       if (label->length > EXFAT_ENAME_MAX)
+                       {
+                               exfat_error("too long label (%hhu chars)", label->length);
+                               return -EIO;
+                       }
+                       break;
                }
 
                /* fetch the next cluster if needed */