From b9c67409576dcff3c5d45aafd20f4554100f647c Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 11 Jul 2008 21:46:32 +0000 Subject: [PATCH] Fixed 'negative unsigned' index causing crash (Zarafa). --- src/body.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/body.cpp b/src/body.cpp index b9180d74..88414ab6 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -141,8 +141,8 @@ void body::parse(const string& buffer, const string::size_type position, string::size_type partEnd = pos; // Get rid of the [CR]LF just before the boundary string - if (pos - 1 >= position && buffer[pos - 1] == '\n') --partEnd; - if (pos - 2 >= position && buffer[pos - 2] == '\r') --partEnd; + if (pos >= (position + 1) && buffer[pos - 1] == '\n') --partEnd; + if (pos >= (position + 2) && buffer[pos - 2] == '\r') --partEnd; // Check whether it is the last part (boundary terminated by "--") pos += boundarySep.length();