git.samba.org
/
jerry
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f76e5b2
)
Cope with negative cache dns entries better.
author
Tim Potter
<tpot@samba.org>
Fri, 23 Aug 2002 15:01:08 +0000
(15:01 +0000)
committer
Tim Potter
<tpot@samba.org>
Fri, 23 Aug 2002 15:01:08 +0000
(15:01 +0000)
source/libsmb/namecache.c
patch
|
blob
|
history
diff --git
a/source/libsmb/namecache.c
b/source/libsmb/namecache.c
index d985832613ffc4d1768a0f1d6f9b0d5a0122a633..31341df86ed2b72dbd415ccbd12545e7ab3c3efd 100644
(file)
--- a/
source/libsmb/namecache.c
+++ b/
source/libsmb/namecache.c
@@
-91,19
+91,20
@@
static TDB_DATA namecache_value(struct in_addr *ip_list, int num_names,
{
TDB_DATA retval;
struct nc_value *value;
- int size;
-
- size = sizeof(struct nc_value);
+ int size = sizeof(struct nc_value);
if (num_names > 0)
size += sizeof(struct in_addr) * (num_names-1);
value = (struct nc_value *)malloc(size);
-
+
+ memset(value, 0, size);
+
value->expiry = expiry;
value->count = num_names;
- memcpy(value->ip_list, ip_list, sizeof(*ip_list));
+ if (ip_list)
+ memcpy(value->ip_list, ip_list, sizeof(*ip_list));
retval.dptr = (char *)value;
retval.dsize = size;