public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
From: "eggert at gnu dot org" <sourceware-bugzilla@sources.redhat.com>
To: glibc-bugs-regex@sources.redhat.com
Subject: [Bug regex/1286] New: portability bugs in comparing size_t versus in regex_internal code
Date: Thu, 01 Sep 2005 20:59:00 -0000	[thread overview]
Message-ID: <20050901205920.1286.eggert@gnu.org> (raw)

The regex_internal code assigns the result of mbrtowc to an int
variable, but this has undefined behavior if (size_t) -1 cannot be
represented as an int.

Less importantly, the code compares X + 2 > 2 where X is of type
size_t, but this doesn't have the desired behavior in the (admittedly
very unlikely) case where size_t is narrower than int, since in that
case the comparison is signed rather than unsigned.

I'll attach a patch.

-- 
           Summary: portability bugs in comparing size_t versus in
                    regex_internal code
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: eggert at gnu dot org
                CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
                    bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=1286

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


             reply	other threads:[~2005-09-01 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01 20:59 eggert at gnu dot org [this message]
2005-09-01 20:59 ` [Bug regex/1286] " eggert at gnu dot org
2005-09-07  0:47 ` drepper at redhat dot com

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=20050901205920.1286.eggert@gnu.org \
    --to=sourceware-bugzilla@sources.redhat.com \
    --cc=glibc-bugs-regex@sources.redhat.com \
    /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).