Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 645018 Details for
Bug 871620
CVE-2012-4562 libssh: multiple improper overflow checks
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
CVE-2012-4562-Fix-possible-string-related-integer-ov.patch
0004-CVE-2012-4562-Fix-possible-string-related-integer-ov.patch (text/plain), 1.52 KB, created by
Andreas Schneider
on 2012-11-14 16:47:34 UTC
(
hide
)
Description:
CVE-2012-4562-Fix-possible-string-related-integer-ov.patch
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2012-11-14 16:47:34 UTC
Size:
1.52 KB
patch
obsolete
>From e3d9501b31a11b427afe1cc1cba5208adc2c3c39 Mon Sep 17 00:00:00 2001 >From: Xi Wang <xi.wang@gmail.com> >Date: Fri, 25 Nov 2011 23:02:57 -0500 >Subject: [PATCH 04/13] CVE-2012-4562: Fix possible string related integer > overflows. > > >Signed-off-by: Andreas Schneider <asn@cryptomilk.org> >--- > src/string.c | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > >diff --git a/src/string.c b/src/string.c >index ff633ac..24be06c 100644 >--- a/src/string.c >+++ b/src/string.c >@@ -22,6 +22,7 @@ > */ > > #include <errno.h> >+#include <limits.h> > #include <stdlib.h> > #include <string.h> > >@@ -52,7 +53,11 @@ > struct ssh_string_struct *ssh_string_new(size_t size) { > struct ssh_string_struct *str = NULL; > >- str = malloc(size + 4); >+ if (size > UINT_MAX - sizeof(struct ssh_string_struct)) { >+ return NULL; >+ } >+ >+ str = malloc(sizeof(struct ssh_string_struct) + size); > if (str == NULL) { > return NULL; > } >@@ -142,16 +147,22 @@ size_t ssh_string_len(struct ssh_string_struct *s) { > char *ssh_string_to_char(struct ssh_string_struct *s) { > size_t len; > char *new; >- if(s==NULL || s->string == NULL) >- return NULL; >- len = ntohl(s->size) + 1; >- new = malloc(len); >+ if (s == NULL || s->string == NULL) { >+ return NULL; >+ } > >+ len = ssh_string_len(s); >+ if (len + 1 < len) { >+ return NULL; >+ } >+ >+ new = malloc(len + 1); > if (new == NULL) { > return NULL; > } >- memcpy(new, s->string, len - 1); >- new[len - 1] = '\0'; >+ memcpy(new, s->string, len); >+ new[len] = '\0'; >+ > return new; > } > >-- >1.8.0 >
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 871620
:
645002
|
645003
|
645004
| 645018