Fix off-by-one error in working out the limit of the NetServerEnum comment.
[amitay/samba.git] / source3 / libsmb / clirap.c
index 7f6dbf5bbb5abc4efa32a3bb96b925f9f1a481a9..990b8063ca9cd30ce7eb366c6a1f48092928ab0a 100644 (file)
@@ -367,7 +367,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;
                                }