Fix bug reported on IRC enumerating shares with OS/2.
authorJeremy Allison <jra@samba.org>
Fri, 8 Feb 2008 18:07:05 +0000 (10:07 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 8 Feb 2008 18:07:05 +0000 (10:07 -0800)
Report and fix from kukks (thanks once again !).
Jeremy.
(This used to be commit 3ca58b792fb10ff2a4c25283c587f8270ed82d74)

source3/libsmb/clirap.c

index 4c5e338606f9f2b8c9a7d120ec2bc82c2b46239c..8c167e1257d01bc43aa76a98663b3ad7fc63cf0a 100644 (file)
@@ -191,12 +191,13 @@ int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, co
 
                                        sname = p;
                                        type = SVAL(p,14);
-                                       comment_offset = IVAL(p,16) & 0xFFFF;
-                                       if (comment_offset < 0 || comment_offset > (int)rdrcnt) {
+                                       comment_offset = (IVAL(p,16) & 0xFFFF) - converter;
+                                       if (comment_offset < 0 ||
+                                                       comment_offset > (int)rdrcnt) {
                                                TALLOC_FREE(frame);
                                                break;
                                        }
-                                       cmnt = comment_offset?(rdata+comment_offset-converter):"";
+                                       cmnt = comment_offset?(rdata+comment_offset):"";
 
                                        /* Work out the comment length. */
                                        for (p1 = cmnt, len = 0; *p1 &&