On 7/10/25 3:45 AM, Alex Bennée wrote:
From: Yodel Eldar <yodel.el...@gmail.com>
Currently, execlog searches for a space separator between the
instruction mnemonic and operands, but some disassemblers, e.g. Alpha's,
use a tab separator instead; this results in a null pointer being passed
as the haystack in g_strstr during a subsequent register search, i.e.
undefined behavior, because of a missing null check.
This patch adds tab to the separator search and a null check on the
result.
Also, an affected pointer is changed to const.
Lastly, a break statement was added to immediately terminate the
register search when a user-requested register is found in the current
instruction as a trivial optimization, because searching for the
remaining requested registers is unnecessary once one is found.
Suggested-by: Alex Bennée <alex.ben...@linaro.org>
Signed-off-by: Yodel Eldar <yodel.el...@gmail.com>
Message-ID: <20250630164124.26315-2-yodel.el...@gmail.com>
Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
---
contrib/plugins/execlog.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>