Fixes: fd0561279
During `tdbtool storehex`, tdbtool check whether the input
string in hex format.
However, during the check, the index is never moved forward,
resulting in checking beyond the valid input string.
This patch fix the issue by checking the valid string
Signed-off-by: Lin Liu <lin.liu01@citrix.com>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Thu Nov 20 22:29:03 UTC 2025 on atb-devel-224
static bool parse_hex(const char *src, size_t srclen, uint8_t *dst)
{
- size_t i=0;
+ const char *end = src + srclen;
if ((srclen % 2) != 0) {
return false;
}
- while (i<srclen) {
+ while (src < end) {
bool ok = hex_byte(src, dst);
if (!ok) {
return false;