Skip to content

Commit

Permalink
Merge pull request #1608 from FIWARE/issue/1558
Browse files Browse the repository at this point in the history
Fixed buffer overwritten on libcurl for https notification request
  • Loading branch information
kzangeli authored Apr 23, 2024
2 parents 441199d + b4f7347 commit c66ba5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/lib/orionld/notifications/notificationSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ size_t userAgentHeaderLen = 0; // Set in orionldServiceInit()



// -----------------------------------------------------------------------------
//
// static buffer for small notifications (payload body)
//
static __thread char body[4 * 1024];



// -----------------------------------------------------------------------------
//
// attributeToSimplified - move to its own module
Expand Down Expand Up @@ -699,7 +691,7 @@ int notificationSend(OrionldAlterationMatch* mAltP, double timestamp, CURL** cur
}

long unsigned int payloadBodySize = kjFastRenderSize(notificationP);
char* payloadBody = (payloadBodySize < sizeof(body))? body : kaAlloc(&orionldState.kalloc, payloadBodySize);
char* payloadBody = kaAlloc(&orionldState.kalloc, payloadBodySize + 512);

kjFastRender(notificationP, payloadBody);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Ngsild-Attribute-Format: Normalized
],
"id": "urn:ngsi-ld:Notification:REGEX(.*)",
"notifiedAt": "202REGEX(.*)Z",
"subscriptionId": "urn:S1",
"subscriptionId": "urn:S2",
"type": "Notification"
}
=======================================
Expand Down

0 comments on commit c66ba5c

Please sign in to comment.