diff options
author | 2007-09-02 15:19:07 +0000 | |
---|---|---|
committer | 2007-09-02 15:19:07 +0000 | |
commit | 1ed98fdf61d9dd29369f246109081408082ce54d (patch) | |
tree | ad7631e58c83830d1fc51cbadb9a2da53c1abfb7 /libexec/spamd/sdl.c | |
parent | OpenCVS server init-support with OpenCVS and GNU cvs clients. (diff) | |
download | wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.tar.xz wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.zip |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'libexec/spamd/sdl.c')
-rw-r--r-- | libexec/spamd/sdl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/spamd/sdl.c b/libexec/spamd/sdl.c index d3d08525748..4f88b5133aa 100644 --- a/libexec/spamd/sdl.c +++ b/libexec/spamd/sdl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdl.c,v 1.16 2007/03/26 16:36:18 beck Exp $ */ +/* $OpenBSD: sdl.c,v 1.17 2007/09/02 15:19:20 deraadt Exp $ */ /* * Copyright (c) 2003-2007 Bob Beck. All rights reserved. @@ -99,7 +99,7 @@ sdl_add(char *sdname, char *sdstring, char ** addrs, int addrc) * formatted v4 and v6 addrs, if they don't all convert correctly, the * add fails. Each address should be address/maskbits */ - blacklists[idx].addrs = malloc(addrc * sizeof(struct sdentry)); + blacklists[idx].addrs = calloc(addrc, sizeof(struct sdentry)); if (blacklists[idx].addrs == NULL) goto misc_error; |