bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: Re: [PATCH] base32, base64: prefer signed to unsigned integers
Date: Sun, 29 Aug 2021 10:25:54 -0700	[thread overview]
Message-ID: <760438a6-836b-3a90-fb2c-cfc09da59908@cs.ucla.edu> (raw)
In-Reply-To: <4040691.xgJ6IN8ObU@omega>

On 8/29/21 3:16 AM, Bruno Haible wrote:

> There may be invocations out there, of this
> function, with an argument between SIZE_MAX/2 and SIZE_MAX-1. Changing
> such calls to be undefined behaviour means that these invocations now
> need debugging in the packages that contain them.

Luckily these calls are not present in practical code (as opposed to 
artificial test cases).

> IMO, it would be better to have code like this in base64_encode_alloc:
> 
>   if (inlen < 0)
>     /* This argument is invalid, since the API change from 2021-08-28.  */
>     abort ();

Another possibility would be to treat inlen < 0 the same as integer 
overflow. I could go either way.


  reply	other threads:[~2021-08-29 17:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 22:27 [PATCH] base32, base64: prefer signed to unsigned integers Paul Eggert
2021-08-28 12:45 ` Bruno Haible
2021-08-28 14:12   ` Bruno Haible
2021-08-29  7:57     ` Paul Eggert
2021-08-29 10:16       ` Bruno Haible
2021-08-29 17:25         ` Paul Eggert [this message]
2021-08-29 18:36           ` Bruno Haible
2021-08-29 20:01             ` Paul Eggert
2021-08-29  7:49   ` Paul Eggert
2021-09-19 22:07     ` ialloc: relicense Bruno Haible
2021-08-29  8:20 ` [PATCH] base32, base64: prefer signed to unsigned integers Simon Josefsson via Gnulib discussion list
2021-08-29  9:56   ` Bruno Haible
2021-08-30 14:12     ` Simon Josefsson via Gnulib discussion list
2021-08-30 18:17       ` Paul Eggert
2021-08-30 18:58         ` Simon Josefsson via Gnulib discussion list
2021-09-04 10:06         ` autoupdate again Bruno Haible
2021-09-04 16:47           ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=760438a6-836b-3a90-fb2c-cfc09da59908@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).