[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem using install-info with tar.info
From: |
Gavin Smith |
Subject: |
Re: problem using install-info with tar.info |
Date: |
Sat, 7 Nov 2015 12:41:12 +0000 |
On 4 November 2015 at 18:38, Alan Wehmann <address@hidden> wrote:
> In "install-info_orig_seq.c" the line:
>
> 1447 strncat (*outstr, line_out, offset_out);
>
> is where the error occurred.
>
> After some study I decided to try making sure that "line_out" is terminated
> by a '\0' character, so I have the code in "install-info_altered_seq.c":
>
> 1465 line_out = (char *) realloc ((void *)line_out,
> allocated_out+1);
> 1466 line_out[offset_out+1] = '\0';
>
> that adds a '\0' character to "line_out" and allocates space for it.
> This seemed to make the problem with “strncat” go away.
Assuming offset_out isn't too big (it wasn't as far as I could tell),
my best guess is that strncat is reading too far in the source array,
and extending its allocation prevents an error being signalled.
Diffs are preferred for showing the changes you made to code, for
example "cp install-info.c install-info-fixed.c", then edit
install-info-fixed.c, finally post the output of "diff -u
install-info.c install-info-fixed.c".
- Re: problem using install-info with tar.info, Gavin Smith, 2015/11/01
- Re: problem using install-info with tar.info, Alan Wehmann, 2015/11/04
- Re: problem using install-info with tar.info, Gavin Smith, 2015/11/07
- Re: problem using install-info with tar.info,
Gavin Smith <=
- Re: problem using install-info with tar.info, Alan Wehmann, 2015/11/07
- Re: problem using install-info with tar.info, Gavin Smith, 2015/11/07
- Re: problem using install-info with tar.info, Alan Wehmann, 2015/11/07
- Re: problem using install-info with tar.info, Gavin Smith, 2015/11/09
- Re: problem using install-info with tar.info, Gavin Smith, 2015/11/22