db_auc: hexparse_stmt(): check value returned by osmo_hexparse()

Change-Id: I78bb3aff9dd57a38278bb34113ea764e0a54c439
Fixes: CID#272997
This commit is contained in:
Vadim Yanitskiy 2022-06-28 17:55:42 +07:00 committed by fixeria
parent 65f51535d0
commit 6156950634
1 changed files with 4 additions and 1 deletions

View File

@ -95,7 +95,10 @@ static int hexparse_stmt(uint8_t *dst, size_t dst_len, sqlite3_stmt *stmt, int c
LOGAUC(imsi, LOGL_ERROR, "Error reading %s\n", col_name); LOGAUC(imsi, LOGL_ERROR, "Error reading %s\n", col_name);
return -EIO; return -EIO;
} }
osmo_hexparse((void *)text, dst, dst_len);
if (osmo_hexparse((void *)text, dst, dst_len) != col_len)
return -EINVAL;
return 0; return 0;
} }