πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #93019

Re: INN snapshots

#93019
From: Russ Allbery
Date: Thu, 06 Aug 2026 19:19
22 lines
1720 bytes
Julien Γ‰LIE <iulius@nom-de-mon-site.com.invalid> writes:

> I have just committed a fix:

> -    if (sb.st_size < 0 || sb.st_size > UINT_MAX) {
> +    if (sb.st_size < 0 || (unsigned int) sb.st_size > UINT_MAX) {

> The snapshots should be generated tomorrow.

This is a weird check and I don't entirely understand the point of it, but
sb.st_size is off_t which can be longer than unsigned int (and I think
*can* even be larger than unsigned long since it could be a signed long
long), so doing the cast that way risks overflow and a false negative on
the comparison, I think. Instead, I think you want:

    if (sb.st_size < 0 || sb.st_size > (off_t) UINT_MAX) {

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87bjbfys3j.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.eyrie.org!.POSTED!not-for-mail
References: <11523nj$13ag$8@gallifrey.nk.ca> <1152jlp$742n$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.eyrie.org!.POSTED!not-for-mail
From: Russ Allbery <eagle@eyrie.org>
Newsgroups: news.software.nntp
Subject: Re: INN snapshots
Date: Thu, 06 Aug 2026 12:19:28 -0700
Organization: The Eyrie
Message-ID: <87bjbfys3j.fsf@hope.eyrie.org>
References: <11523nj$13ag$8@gallifrey.nk.ca>
	<1152jlp$742n$1@news.trigofacile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: hope.eyrie.org;
	logging-data="15597"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:+xf0D6+i8gmdnVYt/eorH05bBO4=