From: ramsdell@mitre.org (John D. Ramsdell)
To: selinux@tycho.nsa.gov
Subject: Re: [patch] libselinux: fix type mismatch in string_to_security_class
Date: 24 Jul 2007 14:05:00 -0400 [thread overview]
Message-ID: <ogtodi14r03.fsf@oolong.mitre.org> (raw)
In-Reply-To: <1185200517.1998.14.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley <sds@tycho.nsa.gov> writes:
> Fix type mismatch in string_to_security_class, produces seg fault on x86_64.
> For https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=249038
...
> - size_t value;
> + unsigned int value;
...
>
> - if (sscanf(buf, "%u", (unsigned int *)&value) != 1)
> + if (sscanf(buf, "%u", &value) != 1)
There is another way to fix this bug. You can leave the type as
size_t, but use the C99 z modifier. GCC supports the z modifier.
> - if (sscanf(buf, "%u", (unsigned int *)&value) != 1)
> + if (sscanf(buf, "%zu", &value) != 1)
John
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2007-07-24 18:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 14:21 [patch] libselinux: fix type mismatch in string_to_security_class Stephen Smalley
2007-07-23 15:56 ` Joshua Brindle
2007-07-24 18:05 ` John D. Ramsdell [this message]
2007-07-24 19:05 ` Stephen Smalley
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=ogtodi14r03.fsf@oolong.mitre.org \
--to=ramsdell@mitre.org \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.