diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | openbsd-compat/getrrsetbyname.c | 10 |
2 files changed, 11 insertions, 5 deletions
@@ -43,6 +43,10 @@ | |||
43 | offsite. ok djm@, man page bits ok jmc@ | 43 | offsite. ok djm@, man page bits ok jmc@ |
44 | - (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some | 44 | - (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some |
45 | platforms don't have it. Patch from dleonard at vintela.com. | 45 | platforms don't have it. Patch from dleonard at vintela.com. |
46 | - (dtucker) [openbsd-compat/getrrsetbyname.c] Don't attempt to calloc | ||
47 | an array for signatures when there are none since "calloc(0, n) returns | ||
48 | NULL on some platforms (eg Tru64), which is explicitly permitted by | ||
49 | POSIX. Diagnosis and patch by svallet genoscope.cns.fr. | ||
46 | 50 | ||
47 | 20070128 | 51 | 20070128 |
48 | - (djm) [channels.c serverloop.c] Fix so-called "hang on exit" (bz #52) | 52 | - (djm) [channels.c serverloop.c] Fix so-called "hang on exit" (bz #52) |
@@ -2738,4 +2742,4 @@ | |||
2738 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 2742 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
2739 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 2743 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
2740 | 2744 | ||
2741 | $Id: ChangeLog,v 1.4618 2007/02/19 11:44:25 dtucker Exp $ | 2745 | $Id: ChangeLog,v 1.4619 2007/02/19 11:56:55 dtucker Exp $ |
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 6c86e02c2..07231d005 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c | |||
@@ -303,10 +303,12 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, | |||
303 | } | 303 | } |
304 | 304 | ||
305 | /* allocate memory for signatures */ | 305 | /* allocate memory for signatures */ |
306 | rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); | 306 | if (rrset->rri_nsigs > 0) { |
307 | if (rrset->rri_sigs == NULL) { | 307 | rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); |
308 | result = ERRSET_NOMEMORY; | 308 | if (rrset->rri_sigs == NULL) { |
309 | goto fail; | 309 | result = ERRSET_NOMEMORY; |
310 | goto fail; | ||
311 | } | ||
310 | } | 312 | } |
311 | 313 | ||
312 | /* copy answers & signatures */ | 314 | /* copy answers & signatures */ |