summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-01-11 14:02:52 +0100
committerStefan Metzmacher <metze@samba.org>2013-01-11 17:10:49 +0100
commit54e01f68e7a6869a203bfdbdcc6c0294835b841f (patch)
tree9858e496dfdf390a447f2686261740cc450b55b8 /source3
parentaea49ed37afe49d12fbb6303f6ea5e7f984b2fda (diff)
downloadsamba-54e01f68e7a6869a203bfdbdcc6c0294835b841f.tar.gz
samba-54e01f68e7a6869a203bfdbdcc6c0294835b841f.tar.bz2
samba-54e01f68e7a6869a203bfdbdcc6c0294835b841f.zip
winbind: Fix error check in unpack_tdc_domains
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 76970d6be4..fbfaa1dbaf 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -4455,7 +4455,9 @@ static size_t unpack_tdc_domains( unsigned char *buf, int buflen,
}
for ( i=0; i<num_domains; i++ ) {
- len += tdb_unpack( buf+len, buflen-len, "fffddd",
+ int this_len;
+
+ this_len = tdb_unpack( buf+len, buflen-len, "fffddd",
domain_name,
dns_name,
sid_string,
@@ -4463,11 +4465,12 @@ static size_t unpack_tdc_domains( unsigned char *buf, int buflen,
&attribs,
&type );
- if ( len == -1 ) {
+ if ( this_len == -1 ) {
DEBUG(5,("unpack_tdc_domains: Failed to unpack domain array\n"));
TALLOC_FREE( list );
return 0;
}
+ len += this_len;
DEBUG(11,("unpack_tdc_domains: Unpacking domain %s (%s) "
"SID %s, flags = 0x%x, attribs = 0x%x, type = 0x%x\n",