bugmake - Bugs: bug #54533, Touching an archive member leaves...

 
 

bug #54533: Touching an archive member leaves a NUL byte after date field

Submitter:  None
Submitted:  Sat 18 Aug 2018 03:01:18 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  POSIX-Based
Fixed Release:  4.3 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 18 Aug 2018 03:01:18 PM UTC, original submission:  

When make touches an archive member via something like:

touch b
ar -rc a b
make -Bt 'a(b)'

$ xxd a
00000000: 213c 6172 6368 3e0a 622f 2020 2020 2020  !<arch>.b/     
00000010: 2020 2020 2020 2020 3135 3334 3630 3435          15346045
00000020: 3631 0020 3020 2020 2020 3020 2020 2020  61. 0     0    
00000030: 3634 3420 2020 2020 3020 2020 2020 2020  644     0      
00000040: 2020 600a

note the NUL at offset 22

This looks to be caused in arscan.c :

>  903 #if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)`
>  904   /* Advance member's time to that time */`
>  905   for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)`
>  906     ar_hdr.ar_date[ui] = ' ';`
>  907   sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);`
>  908 #ifdef AIAMAG`
>  909   ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';`
>  910 #endif`
>  911 #else`
>  912   ar_hdr.ar_date = statbuf.st_mtime;`
>  913 #endif`


I think the "ifdef AIAMAG" should be removed as you always want the NUL byte after the sprintf set back to a space.  Maybe make sure that the field is not overrun.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-16 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code