Project

Profile

Help

Bug #5983

closed

Saxon.C.API/SaxonApiException.cpp calculates wrong strlen

Added by Andreas Oetjen about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Low
Category:
C++ API
Start date:
2023-04-19
Due date:
% Done:

100%

Estimated time:
Found in version:
12.1
Fixed in version:
12.2
Platforms:

Description

Lines 86ff:

if(sysId != nullptr) {
    //systemId = (char *)sysId;
    size_t destination_size = strlen(ec);
    systemId = (char *)malloc(sizeof(char)*destination_size);
    snprintf(systemId, destination_size, "%s", sysId);
} else {
    systemId = nullptr;
}

here strlen(ec) is wrong, it should be strlen(sysId), because this is what snprintf uses.

Actions #1

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Thanks for spotting this typo. Patched in the repo for the next maintenance release.

Actions #2

Updated by O'Neil Delpratt 12 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.2

Bug fix applied in the SaxonC 12.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF