[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Review Request (Bug 39453)
From: |
Tim Rühsen |
Subject: |
Re: [Bug-wget] Review Request (Bug 39453) |
Date: |
Wed, 07 Aug 2013 21:54:23 +0200 |
User-agent: |
KMail/4.10.5 (Linux/3.10-1-amd64; KDE/4.10.5; x86_64; ; ) |
Am Mittwoch, 7. August 2013, 08:24:35 schrieb Will Dietz:
> Hi all,
>
> There's a minor integer error in wget as described in the following bug
> report:
>
> https://savannah.gnu.org/bugs/?39453
>
> Patch is included, please review.
>
> Thanks!
Hi Will,
isn't the real problem a signed/unsigned comparison ?
If remaining_chars becomes negative (due to token is longer or equal to
line_length), the comparison
if (remaining_chars <= strlen (token))
is false or at least undefined.
If we change it to
if (remaining_chars <= (int) strlen (token))
the function should work.
Using gcc -Wsign-compare warns about such constructs.
Isn't there another bug, when setting
remaining_chars = line_length - TABULATION;
?
line_length might already be without TABULATION:
if (line_length <= 0)
line_length = MAX_CHARS_PER_LINE - TABULATION;
Regards, Tim
signature.asc
Description: This is a digitally signed message part.