Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 70966 | Differences between
and this patch

Collapse All | Expand All

(-)unarj-2.65/unarj.c (-3 / +8 lines)
Lines 217-223 static uchar arj_flags; Link Here
217
static short  method;
217
static short  method;
218
static uint   file_mode;
218
static uint   file_mode;
219
static ulong  time_stamp;
219
static ulong  time_stamp;
220
static short  entry_pos;
220
static ushort entry_pos;
221
static ushort host_data;
221
static ushort host_data;
222
static uchar  *get_ptr;
222
static uchar  *get_ptr;
223
static UCRC   file_crc;
223
static UCRC   file_crc;
Lines 608-613 char *name; Link Here
608
        error(M_BADHEADR, "");
608
        error(M_BADHEADR, "");
609
609
610
    crc = CRC_MASK;
610
    crc = CRC_MASK;
611
    memset(header, 0, sizeof(header));
611
    fread_crc(header, (int) headersize, fd);
612
    fread_crc(header, (int) headersize, fd);
612
    header_crc = fget_crc(fd);
613
    header_crc = fget_crc(fd);
613
    if ((crc ^ CRC_MASK) != header_crc)
614
    if ((crc ^ CRC_MASK) != header_crc)
Lines 632-640 char *name; Link Here
632
633
633
    if (origsize < 0 || compsize < 0)
634
    if (origsize < 0 || compsize < 0)
634
        error(M_HEADRCRC, "");
635
        error(M_HEADRCRC, "");
636
    if(first_hdr_size > headersize-2) /* need two \0 for file and comment */
637
        error(M_BADHEADR, "");
635
638
636
    hdr_filename = (char *)&header[first_hdr_size];
639
    hdr_filename = (char *)&header[first_hdr_size];
637
    strncopy(filename, hdr_filename, sizeof(filename));
640
    strncopy(filename, hdr_filename, sizeof(filename));
641
    if(entry_pos >= strlen(filename))
642
        error(M_BADHEADR, "");
638
    if (host_os != OS)
643
    if (host_os != OS)
639
        strparity((uchar *)filename);
644
        strparity((uchar *)filename);
640
    if ((arj_flags & PATHSYM_FLAG) != 0)
645
    if ((arj_flags & PATHSYM_FLAG) != 0)
Lines 733-743 extract() Link Here
733
738
734
    no_output = 0;
739
    no_output = 0;
735
    if (command == 'E')
740
    if (command == 'E')
736
        strcpy(name, &filename[entry_pos]);
741
        strncopy(name, &filename[entry_pos], sizeof(name));
737
    else
742
    else
738
    {
743
    {
739
        strcpy(name, DEFAULT_DIR);
744
        strcpy(name, DEFAULT_DIR);
740
        strcat(name, filename);
745
        strncopy(name+strlen(name), filename, sizeof(name)-strlen(name));
741
    }
746
    }
742
747
743
    if (host_os != OS)
748
    if (host_os != OS)

Return to bug 70966