From: helge Date: Sun, 22 Jan 2006 22:28:07 +0000 (+0000) Subject: fixed a bug in plist comment parsing X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6354a23ea2e72a6ed735ce61637828906ea2ce12;p=sope fixed a bug in plist comment parsing git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1203 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index b7ee7219..65be8081 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,8 @@ +2006-01-22 Helge Hess + + * FdExt.subproj/NGPropertyListParser.m (_skipComments): fixed a bug + when parsing comments which contain stars (v4.5.181) + 2005-12-13 Helge Hess * NGQuotedPrintableCoding.m (NGDecodeQuotedPrintable): properly decode diff --git a/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m b/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m index a62c2077..f5c7e76e 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m +++ b/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m @@ -525,20 +525,25 @@ static BOOL _skipComments(const unsigned char *_buffer, unsigned *_idx, unsigned pos += 2; // skip '/*' - do { // search for '*/' + do { + // search for '*/' while ((pos < _len) && (_buffer[pos] != '*')) pos++; - - if (pos < _len) { // found '*' - if ((pos + 1) < _len) { - if (_buffer[pos + 1] == '/') { // found '*/' - commentIsClosed = YES; - pos += 2; // skip '*/' - lookAgain = YES; - break; // leave loop - } - } - } + + if (pos + 1 >= _len) + // did not find '*' or not enough left for '/' + break; + + pos++; // skip '*' + + if (_buffer[pos] != '/') + // missing slash in '*/' + continue; + + commentIsClosed = YES; + pos++; // skip '/' + lookAgain = YES; + break; // leave loop } while (pos < _len); diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 91ad9c03..2caa4b29 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=180 +SUBMINOR_VERSION:=181 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39