bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [PATCH] Invalid Content-Length header in WARC files, on s


From: Tim Ruehsen
Subject: Re: [Bug-wget] [PATCH] Invalid Content-Length header in WARC files, on some platforms
Date: Wed, 14 Nov 2012 11:32:10 +0100
User-agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )

Hi,

as David Ryskalczyk stated, just two printf format specifiers might cause the 
havoc. I think, there is not need to use wgint instead of off_t.

@Guiseppe: please apply the appended patches (maybe adding them together into 
one commit)

@Gijs: Could you check, if these patches fix the issue ?

Regards, Tim

Am Monday 12 November 2012 schrieb Gijs van Tulder:
> Hi,
> 
> There's a somewhat serious issue in the WARC-generating code: on some
> platforms (presumably the ones where off_t is not a 64-bit number) the
> Content-Length header at the top of each WARC record has an incorrect
> length. On these platforms it is sometimes 0, sometimes 1, but never the
> correct length. This makes the whole WARC file unreadable.
> 
> The code works fine on many platforms, but it is apparently a problem on
> some PowerPC and ARM systems, and maybe other systems as well.
> 
> Existing WARC files with this problem can be repaired by replacing the
> value of the Content-Length header with the correct value, for each WARC
> record in the file. The content of the WARC records is there, it's just
> the Content-Length header that is wrong.
> 
> The attached patch fixes the problem in warc.c. It replaces off_t by
> wgint and uses the number_to_static_string function from util.c.
> 
> Regards,
> 
> Gijs

Mit freundlichem Gruß

     Tim Rühsen

Attachment: 0001-fix-output-of-off_t-variables.patch
Description: Text Data

Attachment: 0002-fix-checking-asprintf-return-value.patch
Description: Text Data

Attachment: 0001-added-ChangeLog-entries.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]