Message ID | 1568998314-91506-1-git-send-email-u9012063@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,PATCHv2] stream_ssl: fix important memory leak in ssl_connect() function | expand |
Bleep bloop. Greetings William Tu, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: William Tu <u9012063@gmail.com> Lines checked: 248, Warnings: 1, Errors: 0 Please check this out. If you feel there has been an error, please email aconole@redhat.com Thanks, 0-day Robot
Hi Ben, I'm not the co-author of this patch, I'm just sending for the original author. Please remove me, thanks William On Fri, Sep 20, 2019 at 10:01 AM 0-day Robot <robot@bytheb.org> wrote: > > Bleep bloop. Greetings William Tu, I am a robot and I have tried out your patch. > Thanks for your contribution. > > I encountered some error that I wasn't expecting. See the details below. > > > checkpatch: > WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: William Tu <u9012063@gmail.com> > Lines checked: 248, Warnings: 1, Errors: 0 > > > Please check this out. If you feel there has been an error, please email aconole@redhat.com > > Thanks, > 0-day Robot
On Fri, Sep 20, 2019 at 09:51:54AM -0700, William Tu wrote: > From: Damijan Skvarc <damjan.skvarc@gmail.com> > > While checking valgrind reports after running "make check-valgrind" I have noticed > reports for several tests similar to the following: Thanks. I applied this to master and am working on backports.
On Mon, Sep 23, 2019 at 02:26:42PM -0700, Ben Pfaff wrote: > On Fri, Sep 20, 2019 at 09:51:54AM -0700, William Tu wrote: > > From: Damijan Skvarc <damjan.skvarc@gmail.com> > > > > While checking valgrind reports after running "make check-valgrind" I have noticed > > reports for several tests similar to the following: > > Thanks. I applied this to master and am working on backports. Backported as far as 2.8. This code does not appear in earlier versions.
diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index 723fde9ad8fe..078fcbc3aa4a 100644 --- a/lib/stream-ssl.c +++ b/lib/stream-ssl.c @@ -470,6 +470,7 @@ do_ca_cert_bootstrap(struct stream *stream) static char * get_peer_common_name(const struct ssl_stream *sslv) { + char *peer_name = NULL; X509 *peer_cert = SSL_get_peer_certificate(sslv->ssl); if (!peer_cert) { return NULL; @@ -478,18 +479,18 @@ get_peer_common_name(const struct ssl_stream *sslv) int cn_index = X509_NAME_get_index_by_NID(X509_get_subject_name(peer_cert), NID_commonName, -1); if (cn_index < 0) { - return NULL; + goto error; } X509_NAME_ENTRY *cn_entry = X509_NAME_get_entry( X509_get_subject_name(peer_cert), cn_index); if (!cn_entry) { - return NULL; + goto error; } ASN1_STRING *cn_data = X509_NAME_ENTRY_get_data(cn_entry); if (!cn_data) { - return NULL; + goto error; } const char *cn; @@ -499,7 +500,11 @@ get_peer_common_name(const struct ssl_stream *sslv) #else cn = (const char *)ASN1_STRING_get0_data(cn_data); #endif - return xstrdup(cn); + peer_name = xstrdup(cn); + +error: + X509_free(peer_cert); + return peer_name; } static int