summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/getrrsetbyname.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-08-29 08:12:29 +0200
committerDarren Tucker <dtucker@zip.com.au>2004-08-29 08:12:29 +0200
commitf00e51d1f2ea01c33d5548b79a86c44036b90aae (patch)
treee9a8979d45a52964ad6555c66c97d861a999822e /openbsd-compat/getrrsetbyname.c
parentAdd filename to ChangeLog entry (diff)
downloadopenssh-f00e51d1f2ea01c33d5548b79a86c44036b90aae.tar.xz
openssh-f00e51d1f2ea01c33d5548b79a86c44036b90aae.zip
- (dtucker) [openbsd-compat/getrrsetbyname.c] Prevent getrrsetbyname from
failing with NOMEMORY if no sigs are returned and malloc(0) returns NULL. From Martin.Kraemer at Fujitsu-Siemens.com; ok djm@
Diffstat (limited to 'openbsd-compat/getrrsetbyname.c')
-rw-r--r--openbsd-compat/getrrsetbyname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c
index 660427c1f..4e869c4df 100644
--- a/openbsd-compat/getrrsetbyname.c
+++ b/openbsd-compat/getrrsetbyname.c
@@ -277,7 +277,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass,
/* allocate memory for signatures */
rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
- if (rrset->rri_sigs == NULL) {
+ if (rrset->rri_nsigs > 0 && rrset->rri_sigs == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}