Fix potential missing nul character on resolved symbol names

The symbol name returned by SymFromName may not contains a NUL character
when the symbol name is exactly the size of the buffer. It believe this
may also happen when the symbol name is too long and truncated.

The original code is based on:

A right implementation can be found here:

As described here:

    The length of the name, in characters, not including the null-terminating character.
    The size of the Name buffer, in characters. If this member is 0, the Name member is not used.

This issue was causing the catapult symbolisation script to encode incorrect (random) characters into the symbol names.
See the example in the bug.

Original BUG=713741

Cr-Commit-Position: refs/heads/master@{#466098}


Change-Id: Ia6de4ddbd5c66a966b74ecec3fda5e853f36073b
Reviewed-by: Will Harris <>
Commit-Queue: Gabriel Marin <>
Cr-Commit-Position: refs/heads/master@{#578373}
1 file changed