diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2017-03-12 20:59:44 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2017-03-12 21:09:16 -0400 |
commit | 70c929179b80e0657e31558e34d2bc62e1176564 (patch) | |
tree | b359577dabe279aa2e3995f7ef57581d583e7218 /firmware/common/file_internal.c | |
parent | e3081b35cdeb1e568c61369e5b3b15b6e428d3c3 (diff) | |
download | rockbox-70c929179b80e0657e31558e34d2bc62e1176564.tar.gz rockbox-70c929179b80e0657e31558e34d2bc62e1176564.zip |
Dircache: Refine name allocation and error handling.
* 8 bits is enough to allow 260 character base names when five
bytes is the minimum indirect storage size (0..255->5..260).
* Don't truncate anything that's too long as that can lead to
bad behavior, simply don't include the offending entry in the
parent.
* Set the .tinyname flag to 1 by default to indicate that
the entry's name doesn't need freeing. Clear it only when
allocating indirect storage.
* Rename some things to help catch all instances
Change-Id: Iff747b624acbb8e03ed26c24afdf0fc715fd9d99
Diffstat (limited to 'firmware/common/file_internal.c')
-rw-r--r-- | firmware/common/file_internal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c index 8fee802f6f..a109563092 100644 --- a/firmware/common/file_internal.c +++ b/firmware/common/file_internal.c | |||
@@ -505,7 +505,7 @@ walk_path(struct pathwalk *walkp, struct pathwalk_component *compp, | |||
505 | if (!(compp->attr & ATTR_DIRECTORY)) | 505 | if (!(compp->attr & ATTR_DIRECTORY)) |
506 | return -ENOTDIR; | 506 | return -ENOTDIR; |
507 | 507 | ||
508 | if (len >= MAX_NAME) | 508 | if (len > MAX_COMPNAME) |
509 | return -ENAMETOOLONG; | 509 | return -ENAMETOOLONG; |
510 | 510 | ||
511 | /* check for "." and ".." */ | 511 | /* check for "." and ".." */ |