Skip to content

Commit

Permalink
(fix) avoid trying to parse empty request (fixes #3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Dec 29, 2016
1 parent dd93280 commit 366681e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ActiveSync/SOGoActiveSyncDispatcher.m
Expand Up @@ -4018,14 +4018,15 @@ - (NSException *) dispatchRequest: (id) theRequest
}

xml = [NSString stringWithFormat: @"<?xml version=\"1.0\"?><!DOCTYPE ActiveSync PUBLIC \"-//MICROSOFT//DTD ActiveSync//EN\" \"http://www.microsoft.com/\"><%@ xmlns=\"ComposeMail:\"><SaveInSentItems/><MIME>%@</MIME></%@>", cmdName, [s stringByEncodingBase64], cmdName];



d = [xml dataUsingEncoding: NSASCIIStringEncoding];
}
else
{
d = [[theRequest content] wbxml2xml];
// Handle empty Ping request, no need to try decoding the WBXML blob here
if ([[theRequest content] length])
d = [[theRequest content] wbxml2xml];
else
d = nil;
}

documentElement = nil;
Expand Down

0 comments on commit 366681e

Please sign in to comment.