zsh-workers
 help / color / mirror / code / Atom feed
From: Clinton Bunch <cdb_zsh@zentaur.org>
To: zsh-workers@zsh.org
Subject: Re: I think I found a serious bug in zstrtoul_underscore
Date: Sat, 5 Nov 2022 18:41:38 -0500	[thread overview]
Message-ID: <6d9ab07d-680a-f717-d9ba-8d3519311eb0@zentaur.org> (raw)
In-Reply-To: <f2ba86a0-044f-658d-5f47-4ff22e07e35d@zentaur.org>

On 11/5/2022 5:13 PM, Clinton Bunch wrote:
> On 11/5/2022 4:57 PM, Clinton Bunch wrote:
>> This is how I'm calling it:
>>
>> if (!zstrtoul_underscore(OPT_ARG(ops, 'L'), &lower)) {
>>
> I've verified this on FreeBSD 13.1 and Solaris 11.4 as well, so unless 
> I'm calling it wrong, this seems like a serious bug.
>
>
Apparently the problem is with argument handling.  Zsh appears to 
interpret a negative number as another option (but doesn't error with 
unknown option) but  I get the same seg-fault when I don't specify an 
argument to -L as when I specify a negative number.

OPT_ARG_SAFE seems to prevent the seg-fault at that point, but I still 
get one in zstrtoul_underscore.  It seems like specifying that -L 
accepts an argument (specifically a number) should cause it to throw an 
error at argument parse time rather than at recovering the argument.



  reply	other threads:[~2022-11-05 23:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 21:57 Clinton Bunch
2022-11-05 22:13 ` Clinton Bunch
2022-11-05 23:41   ` Clinton Bunch [this message]
2022-11-06  0:24     ` [PATCH} " Clinton Bunch
2022-11-06  5:16       ` Mikael Magnusson
2022-11-06  8:43 ` Roman Perepelitsa
2022-11-06 10:30   ` Clinton Bunch

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

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

  git send-email \
    --in-reply-to=6d9ab07d-680a-f717-d9ba-8d3519311eb0@zentaur.org \
    --to=cdb_zsh@zentaur.org \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).