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

            Bug ID: 2734
           Summary: close() is called twice in confree()
           Product: Portable OpenSSH
           Version: 7.5p1
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: minor
          Priority: P5
         Component: ssh-keyscan
          Assignee: [email protected]
          Reporter: [email protected]

close() is called twice in confree()

Current code - 
ssh_packet_close() internally calls the close() again.

confree(int s)

{
        ......
        ......
        close(s);
        ......
        ......
        if (fdcon[s].c_ssh) {

                ssh_packet_close(fdcon[s].c_ssh);
        ......
        ......

}

Fix -

confree(int s)
{
        ......
        ......
        if (fdcon[s].c_ssh) {
                ssh_packet_close(fdcon[s].c_ssh);
                free(fdcon[s].c_ssh);
                fdcon[s].c_ssh = NULL;
        } else
                close(s);
        ......
        ......
}

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to