From: Jeremy Allison Date: Tue, 9 Feb 2010 20:17:08 +0000 (-0800) Subject: Fix off-by-one error in working out the limit of the NetServerEnum comment. X-Git-Tag: samba-3.6.0pre1~5490 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ad6f432f3f5844b4b419e7cbaf3c3e70b052d29;p=thirdparty%2Fsamba.git Fix off-by-one error in working out the limit of the NetServerEnum comment. Jeremy. --- diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 7f6dbf5bbb5..990b8063ca9 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -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; }