(I hope this mail is sent as text, the corporate mailserver is kinda wonky and the signatures are applied by administrative rule, though I do my best to tinker with the clients settings to remove it.)
Hi, I tested your patch and although it looks logically fine it would not work. I'm sorry for not including an example but I frankly don't know how to reproduce this but I suspect you need to create an a file with filenames>16 chars and get ar to map them. It happens only with one of eight libraries and the whole built system is ancient legacy stuff. The lib is the largest of course, 252 objects with an average filename length of 20 chars. Actually I tinkered around and finally added a printf and got this in your name_len check (line 678): name_len=18 name=DlfRemoveControl.o name_off=18 ARNAME_MAX=16 name_off is probably a coincidence. ARNAME_MAX is 16 due to ar_hdr.ar_name[16] in ar.h (strangely on Android ARNAME_MAX is hardcoded to 255 by the original patch in arscan.c) After reading the comments in this ifdef riddled code I'm not convinced that checking the name_len againt ARNAME_MAX ist correct in the is_mapped part. An earlier part above line 652 comments how traditionally the names are only 14 characters, while the namemap part sets long_name=1 and the comment hints to a GNU addition. This goes for the later(BSD?) code as well where name is actually alloc'ed to a potentially larger size than namebuf can hold. I don't believe (yeah "believe", no idea how this works) namebuf nor ar_name are actually used for those mapped names. Therefore I question that name_len should check against the max size a "mapped name" is allowed to be instead of ar_hdr size. Any idea where this can be found? Or am I completely off? (can't find any reference to ar being limited to 16 chars per se though, and removing the name_len check still works without segfault) I admit I haven't looked up the cause for the original name_len check patch since the upstream tar does not check it, so I might be noisy, sorry. Fun fact, make actually quits with "no rule to make target ../gen/gnmt.a(EnMeasOrig.o)" right after the above printf, These are the first lines of the dep file: se_main: //usr/lib/x86_64-linux-gnu/libm-2.27.a se_main: ../gen/gnmt.a(EnMeasOrig.o) se_main: ../gen/gnmt.a(EnMeasType.o) se_main: ../gen/gnmt.a(EnTapType.o) se_main: ../gen/gnmt.a(gnmt.o) [this goes on for a lot more .o, though se_main does not even use the A to D files like DlfRemoveControl ] -------------------------------------------------------------------------------------------------------------------------------------------- Philipp Wolski - KISTERS AG - Haselriege 13 - 26125 Oldenburg - Germany Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns Kisters | Aufsichtsratsvorsitzender: Dr. Thomas Klevers Phone: +49 441 93602 -158 | Fax: +49 441 93602 -222 | E-Mail: philipp.wol...@kisters.de | WWW: http://www.kisters.de -------------------------------------------------------------------------------------------------------------------------------------------- Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.