damian-m-g / xlsx_drone

Fast Microsoft Excel's *.xlsx reader
MIT License
13 stars 3 forks source link

sxml : fix memory size to store safely the '\0' after the string #8

Closed gvollant closed 1 year ago

gvollant commented 1 year ago

fix crash on xml parser sxml used by xlsx_drone

The _parse_data_SAX alloc a buffer of size strlen(line) for before calling html2str.

html2str create a string with same length of line (or smaller) BUT add a '\0' after the string.

So we need add a +1 on the malloc to avoid valgrind or address sanitizer report or... crash! see https://github.com/matthieu-labas/sxmlc/pull/23/

gvollant commented 1 year ago

the fix is merged on sxmlc https://github.com/matthieu-labas/sxmlc/pull/23

gvollant commented 1 year ago

@damian-m-g did you see this PR?

damian-m-g commented 1 year ago

Hi @gvollant, thanks for the good catch! I'm accepting the PR right now. I'll make the proper release packages soon. I'm overwhelmed with job and university right now.