public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "matt at use dot net" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug build/15017] New: potential buffer overflow uncovered by compiling with -O3 and FORTIFY_SOURCE Date: Mon, 14 Jan 2013 22:41:00 -0000 [thread overview] Message-ID: <bug-15017-4717@http.sourceware.org/bugzilla/> (raw) http://sourceware.org/bugzilla/show_bug.cgi?id=15017 Bug #: 15017 Summary: potential buffer overflow uncovered by compiling with -O3 and FORTIFY_SOURCE Product: gdb Version: 7.5 Status: NEW Severity: critical Priority: P2 Component: build AssignedTo: unassigned@sourceware.org ReportedBy: matt@use.net Classification: Unclassified I got this when compiling the latest Fedora source RPM (7.5.1-32). My default CFLAGS is -O3 instead of the default -O2: In function 'strncat', inlined from 'svr4_create_solib_event_breakpoints' at ../../gdb/solib-svr4.c:2076: /usr/include/bits/string3.h:152: error: call to __builtin___strncat_chk might overflow destination buffer this correctly fails the build. The fix was simple, as the correct use of strncat for the same data is one line below: if (with_prefix) strncat (name, "rtld_", sizeof (name)); strncat (name, probe_info[i].name, sizeof (name) - sizeof ("rtld_")); becomes if (with_prefix) strncat (name, "rtld_", sizeof (name) - sizeof("rtld_")); strncat (name, probe_info[i].name, sizeof (name) - sizeof ("rtld_")); and this eliminates the warning/error. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
next reply other threads:[~2013-01-14 22:41 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-14 22:41 matt at use dot net [this message] 2013-01-14 23:04 ` [Bug build/15017] " sergiodj at redhat dot com 2013-01-15 13:20 ` gbenson 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=bug-15017-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.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: linkBe 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).