Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 353144 Details for
Bug 476622
<net-libs/libssh-0.5.5 - possible double free corruption
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Check-for-NULL-pointers-in-channel.c.patch
Check-for-NULL-pointers-in-channel.c.patch (text/plain), 3.13 KB, created by
Sergey Popov
on 2013-07-12 10:39:03 UTC
(
hide
)
Description:
Check-for-NULL-pointers-in-channel.c.patch
Filename:
MIME Type:
Creator:
Sergey Popov
Created:
2013-07-12 10:39:03 UTC
Size:
3.13 KB
patch
obsolete
>--- libssh-0.5.4.orig/src/channels.c 2013-07-12 14:11:16.867480534 +0400 >+++ libssh-0.5.4.orig/src/channels.c 2013-07-12 14:11:13.951483848 +0400 >@@ -828,13 +828,14 @@ > return -1; > } > >- session = channel->session; >- > if(data == NULL) { > ssh_set_error_invalid(session, __FUNCTION__); > return -1; > } > >+ >+ session = channel->session; >+ > ssh_log(session, SSH_LOG_RARE, > "placing %d bytes into channel buffer (stderr=%d)", len, is_stderr); > if (is_stderr == 0) { >@@ -887,6 +888,10 @@ > * @see channel_request_exec() > */ > int ssh_channel_open_session(ssh_channel channel) { >+ if(channel == NULL) { >+ return SSH_ERROR; >+ } >+ > #ifdef WITH_SSH1 > if (channel->session->version == 1) { > return channel_open_session1(channel); >@@ -929,19 +934,18 @@ > ssh_string str = NULL; > int rc = SSH_ERROR; > >- if (channel == NULL) { >+ if(channel == NULL) { > return rc; > } >- >- session = channel->session; >- >- enter_function(); >- >+ > if(remotehost == NULL || sourcehost == NULL) { > ssh_set_error_invalid(session, __FUNCTION__); > return rc; > } > >+ session = channel->session; >+ enter_function(); >+ > payload = ssh_buffer_new(); > if (payload == NULL) { > ssh_set_error_oom(session); >@@ -1036,9 +1040,14 @@ > * @see channel_free() > */ > int ssh_channel_send_eof(ssh_channel channel){ >- ssh_session session = channel->session; >+ ssh_session session; > int rc = SSH_ERROR; > >+ if(channel == NULL) { >+ return rc; >+ } >+ >+ session = channel->session; > enter_function(); > > if (buffer_add_u8(session->out_buffer, SSH2_MSG_CHANNEL_EOF) < 0) { >@@ -1080,9 +1089,14 @@ > * @see channel_eof() > */ > int ssh_channel_close(ssh_channel channel){ >- ssh_session session = channel->session; >+ ssh_session session; > int rc = 0; > >+ if(channel == NULL) { >+ return SSH_ERROR; >+ } >+ >+ session = channel->session; > enter_function(); > > if (channel->local_eof == 0) { >@@ -2823,11 +2837,17 @@ > */ > int ssh_channel_open_reverse_forward(ssh_channel channel, const char *remotehost, > int remoteport, const char *sourcehost, int localport) { >- ssh_session session = channel->session; >+ ssh_session session; > ssh_buffer payload = NULL; > ssh_string str = NULL; > int rc = SSH_ERROR; > >+ if(channel == NULL) { >+ return rc; >+ } >+ >+ session = channel->session; >+ > enter_function(); > > payload = ssh_buffer_new(); >@@ -2891,6 +2911,10 @@ > ssh_buffer buffer = NULL; > int rc = SSH_ERROR; > >+ if(channel == NULL) { >+ return SSH_ERROR; >+ } >+ > #ifdef WITH_SSH1 > if (channel->version == 1) { > return SSH_ERROR; // TODO: Add support for SSH-v1 if possible. >@@ -2933,7 +2957,8 @@ > * @return SSH_OK on success, SSH_ERROR if an error occured > * (including attempts to send signal via SSH-v1 session). > */ >-int ssh_channel_request_send_exit_signal(ssh_channel channel, const char *sig, int core, const char *errmsg, const char *lang) { >+int ssh_channel_request_send_exit_signal(ssh_channel channel, const char *sig, >+ int core, const char *errmsg, const char *lang) { > ssh_buffer buffer = NULL; > ssh_string tmp = NULL; > int rc = SSH_ERROR;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 476622
:
353144