From 5351b5f8af95bb93220f4613440f05bef978539f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 16 Jan 2010 13:31:44 +0100 Subject: [PATCH] s3: Fix a crash in libsmbclient used against the OpenSolaris CIFS server A user has sent me a sniff where the OpenSolaris CIFS server returns "32" in totalentries, but the array in ctr only contains 15 entries. Look at the right delimiter for walking the array. --- source3/libsmb/libsmb_dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index 143c61c..3884f23 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -303,7 +303,7 @@ net_share_enum_rpc(struct cli_state *cli, } /* For each returned entry... */ - for (i = 0; i < total_entries; i++) { + for (i = 0; i < info_ctr.ctr.ctr1->count; i++) { /* pull out the share name */ fstrcpy(name, info_ctr.ctr.ctr1->array[i].name); -- 1.6.0.4