[Bug 2163] unchecked returned value from pam_get_item()

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Dec 19 11:47:19 EST 2013


https://bugzilla.mindrot.org/show_bug.cgi?id=2163

--- Comment #13 from Darren Tucker <dtucker at zip.com.au> ---
Comment on attachment 2358
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2358
session.c.diff

>-	int n_bytes;
>+	int n_bytes = 0;

What's the intent here, silencing a compiler warning?   n_bytes always
gets initialized before use, in the case of protocol 1 in
session_pty_req():

        /* for SSH1 the tty modes length is not given */
        if (!compat20)
                n_bytes = packet_remaining();
        tty_parse_modes(s->ttyfd, &n_bytes);

and in the protocol 2 case at the start of tty_parse_modes:


        if (compat20) {
                *n_bytes_ptr = packet_get_int();
                if (*n_bytes_ptr == 0)
                        return;

I can imagine a compiler not figuring this out, though.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list