This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26172] generates wrong code for pam_lastlog w/o optimization
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Feb 2006 11:07:29 -0000
- Subject: [Bug c/26172] generates wrong code for pam_lastlog w/o optimization
- References: <bug-26172-12154@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2006-02-08 11:07 -------
/* copy to last_login */
last_login.ll_host[0] = '\0';
^^^^^^^^^
this should probably be ll_line. You'll just get uninitialized stack garbage
at -O0.
fprintf(stderr, "tl = %s\n", terminal_line); /* GCC BUG BELOW THIS LINE */
strncat(last_login.ll_line, terminal_line, sizeof(last_login.ll_line)-1);
fprintf(stderr, "ll = %s\n", last_login.ll_line); /* GCC BUG ABOVE THIS LINE */
terminal_line = NULL;
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26172