Fix off-by-one error in working out the limit of the NetServerEnum comment.
authorJeremy Allison <jra@samba.org>
Tue, 9 Feb 2010 20:17:08 +0000 (12:17 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Feb 2010 15:25:10 +0000 (16:25 +0100)
Jeremy.
(cherry picked from commit 9ad6f432f3f5844b4b419e7cbaf3c3e70b052d29)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8cac1af47cad9d40b0ab86cda3674f4420507008)

source/libsmb/clirap.c

index 116e0a9175916374e9daaecb1950973e25db29c1..ea9e439f1b12d4fcd5a6789cb84aa3b66a5a6da3 100644 (file)
@@ -389,7 +389,7 @@ bool cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
                                comment_offset = (IVAL(p,22) & 0xFFFF)-converter;
                                cmnt = comment_offset?(rdata+comment_offset):"";
 
-                               if (comment_offset < 0 || comment_offset > (int)rdrcnt) {
+                               if (comment_offset < 0 || comment_offset >= (int)rdrcnt) {
                                        TALLOC_FREE(frame);
                                        continue;
                                }