You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2020/12/21 15:40:30 UTC

[qpid-dispatch] branch master updated (45f586b -> 0634a07)

This is an automated email from the ASF dual-hosted git repository.

tross pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


    from 45f586b  NO-JIRA Use checked allocation API from DISPATCH-1685 (#948)
     new a8f08ba  DISPATCH-1900 calling calloc with zero nmemb or zero size is permitted
     new 0634a07  fixup, calloc is allowed to return NULL if nmemb or size is zero

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/qpid/dispatch/ctools.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 02/02: fixup, calloc is allowed to return NULL if nmemb or size is zero

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 0634a070aa6f902bf5b6f9537a5406e4cfc5a0d5
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Mon Dec 21 15:58:50 2020 +0100

    fixup, calloc is allowed to return NULL if nmemb or size is zero
---
 include/qpid/dispatch/ctools.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qpid/dispatch/ctools.h b/include/qpid/dispatch/ctools.h
index d071ffc..3dbb39d 100644
--- a/include/qpid/dispatch/ctools.h
+++ b/include/qpid/dispatch/ctools.h
@@ -237,7 +237,7 @@ static inline void *qd_malloc(size_t size)
 static inline void *qd_calloc(size_t nmemb, size_t size)
 {
     void *ptr = calloc(nmemb, size);
-    if (!ptr) {
+    if (!ptr && nmemb && size) {
         perror("qd_calloc");
         abort();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 01/02: DISPATCH-1900 calling calloc with zero nmemb or zero size is permitted

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit a8f08ba69be2d5e3f322be4e183d512e4f860d15
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Mon Dec 21 15:25:08 2020 +0100

    DISPATCH-1900 calling calloc with zero nmemb or zero size is permitted
---
 include/qpid/dispatch/ctools.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/qpid/dispatch/ctools.h b/include/qpid/dispatch/ctools.h
index d2a11e6..d071ffc 100644
--- a/include/qpid/dispatch/ctools.h
+++ b/include/qpid/dispatch/ctools.h
@@ -236,7 +236,6 @@ static inline void *qd_malloc(size_t size)
 
 static inline void *qd_calloc(size_t nmemb, size_t size)
 {
-    assert(nmemb && size);
     void *ptr = calloc(nmemb, size);
     if (!ptr) {
         perror("qd_calloc");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org