Bugzilla – Attachment 2949 Details for
Bug 2684
calling realloc with a size <= 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The fix for master branch at commit id d5499190559ebe374bcdfa8805408646ceffad64
0001-Check-that-realloc-size-is-greater-than-zero.patch (text/plain), 859 bytes, created by
Tom
on 2017-02-26 07:50:49 AEDT
(
hide
)
Description:
The fix for master branch at commit id d5499190559ebe374bcdfa8805408646ceffad64
Filename:
MIME Type:
Creator:
Tom
Created:
2017-02-26 07:50:49 AEDT
Size:
859 bytes
patch
obsolete
>From fe335c2374baa03f8abd2f61b933566819936628 Mon Sep 17 00:00:00 2001 >From: Tom Rix <trix@juniper.net> >Date: Sun, 26 Feb 2017 03:05:36 -0600 >Subject: [PATCH] Check that realloc size is greater than zero > >--- > openbsd-compat/reallocarray.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/openbsd-compat/reallocarray.c b/openbsd-compat/reallocarray.c >index 1a52acc..54d4695 100644 >--- a/openbsd-compat/reallocarray.c >+++ b/openbsd-compat/reallocarray.c >@@ -36,8 +36,9 @@ > void * > reallocarray(void *optr, size_t nmemb, size_t size) > { >- if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && >- nmemb > 0 && SIZE_MAX / nmemb < size) { >+ if (((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && >+ nmemb > 0 && SIZE_MAX / nmemb < size) || >+ (nmemb * size <= 0)) { > errno = ENOMEM; > return NULL; > } >-- >2.3.3 >
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 2684
: 2949