This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/26172] generates wrong code for pam_lastlog w/o optimization



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]