Skip to content

Commit

Permalink
Fix out of bounds access
Browse files Browse the repository at this point in the history
httpURI may not be NUL-terminated.
  • Loading branch information
rojer authored and carol-apple committed Sep 18, 2020
1 parent 45ea458 commit 6ca3c54
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions HAP/HAPIPAccessoryServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2842,11 +2842,7 @@ static void handle_http_request(HAPIPSessionDescriptor* session) {
}
}
} else {
HAPLogBuffer(
&logObject,
session->httpURI.bytes,
HAPStringGetNumBytes(HAPNonnull(session->httpURI.bytes)),
"Unknown endpoint accessed.");
HAPLogBuffer(&logObject, session->httpURI.bytes, session->httpURI.numBytes, "Unknown endpoint accessed.");
if (session->securitySession.isSecured || kHAPIPAccessoryServer_SessionSecurityDisabled) {
if (!HAPSessionIsTransient(&session->securitySession._.hap)) {
write_msg(&session->outboundBuffer, kHAPIPAccessoryServerResponse_ResourceNotFound);
Expand Down

0 comments on commit 6ca3c54

Please sign in to comment.