[Bug 2163] unchecked returned value from pam_get_item()

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Dec 19 16:36:07 EST 2013


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

--- Comment #14 from Loganaden Velvindron <loganaden at gmail.com> ---
(In reply to Darren Tucker from comment #13)
> Comment on attachment 2358 [details]
> 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.

Yep :-) The compiler didn't figure it out. I should have looked in
other parts of the code.

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