easy_profiler icon indicating copy to clipboard operation
easy_profiler copied to clipboard

EASY_BLOCK can overrun w/ really large block names

Open inantop opened this issue 5 years ago • 3 comments

In a creative (mis)use of EASY_BLOCK we are adding additional diagnostic data to some blocks in debug builds, sometimes this can be a long HTTP response for instance. In one such case we discovered that a buffer overrun was occurring.

The implicit block name limit didn't appear to be documented anywhere, but in addition to documentation perhaps it could be truncated by easy_profiler as well.

inantop avatar Apr 02 '19 15:04 inantop

Hello! Sorry for long time silence. Thank you for feedback. Quick investigation shows that about long name (3k length) for block cause crash =( It's seem to be a bug.

yse avatar May 06 '19 21:05 yse

No problem! Thank you for looking into it.

inantop avatar May 06 '19 21:05 inantop

Memory for the blocks is allocating with chunks of fixed length, this is done for optimization reasons. Really long name has exceed the size of the chunk which lead to crash - that's the reason. Definitely, we should truncate such names automatically to prevent crashes. As for additional diagnostic information, I would better suggest you to use EASY_VALUE blocks to store custom variables and data.

cas4ey avatar Sep 30 '19 09:09 cas4ey