summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-01-16 13:31:44 +0100
committerKarolin Seeger <kseeger@samba.org>2010-02-24 16:25:09 +0100
commit57849c31b9bc4b1ceb0dac63306481e7b50ab161 (patch)
tree93c193af94fb01a2d83a66557d4fcc77a923f979
parentb990e6614f462edb4a00f8ea5665f244a3c9ac40 (diff)
downloadsamba-57849c31b9bc4b1ceb0dac63306481e7b50ab161.tar.gz
samba-57849c31b9bc4b1ceb0dac63306481e7b50ab161.tar.xz
samba-57849c31b9bc4b1ceb0dac63306481e7b50ab161.zip
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. Fix bug #7046 (libsmbclient crash against OpenSolaris CIFS server). (cherry picked from commit 1d611028433db18e96d946b206a8eed1048f9b26)
-rw-r--r--source/libsmb/libsmb_dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index b370f4b9938..845ee5ef656 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/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);