s3: Fix a crash in libsmbclient used against the OpenSolaris CIFS server
authorVolker Lendecke <vl@samba.org>
Sat, 16 Jan 2010 12:31:44 +0000 (13:31 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 16 Jan 2010 12:53:26 +0000 (13:53 +0100)
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

index 6c0b1b4e28b750900a7d2bb28cda10c651a31890..de637a80e8f74b45575bef11bd4f540886575ded 100644 (file)
@@ -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);