summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-02-08 10:07:05 -0800
committerJeremy Allison <jra@samba.org>2008-02-08 10:07:05 -0800
commit3ca58b792fb10ff2a4c25283c587f8270ed82d74 (patch)
treecb2862dd86d1f09775e415a6b3878b7b1b200d63
parent593768c3e98d1ac34e6f9a8b3969662e9be3b707 (diff)
downloadsamba-3ca58b792fb10ff2a4c25283c587f8270ed82d74.tar.gz
samba-3ca58b792fb10ff2a4c25283c587f8270ed82d74.tar.xz
samba-3ca58b792fb10ff2a4c25283c587f8270ed82d74.zip
Fix bug reported on IRC enumerating shares with OS/2.
Report and fix from kukks (thanks once again !). Jeremy.
-rw-r--r--source/libsmb/clirap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/libsmb/clirap.c b/source/libsmb/clirap.c
index 4c5e338606f..8c167e1257d 100644
--- a/source/libsmb/clirap.c
+++ b/source/libsmb/clirap.c
@@ -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 &&