[Bug 103] tar cannot handle names that are exactly 100 chars

bugzilla at busybox.net bugzilla at busybox.net
Thu Feb 12 23:29:09 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=103


Denys Vlasenko <vda.linux at googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vda.linux at googlemail.com




--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com>  2009-02-12 23:29:08 UTC ---
The code is:

        if (!p_longname && parse_names) {
                /* we trash mode[0] here, it's ok */
                //tar.name[sizeof(tar.name)] = '\0'; - gcc 4.3.0 would complain
                tar.mode[0] = '\0';
                if (tar.prefix[0]) {
                        /* and padding[0] */
                        //tar.prefix[sizeof(tar.prefix)] = '\0';
                        tar.padding[0] = '\0';
                        file_header->name = concat_path_file(tar.prefix,
tar.name);
                } else
                        file_header->name = xstrdup(tar.name);
        }

Note how tar.mode[0] = '\0' inserts terminating NUL, thus xstrdup will stop at
100th char.

I also tried to reproduce it and successfully tarred and untarred a file with a
100-characher filename.

Please attach a tar file which unpacks incorrectly with busybox tar.


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list