mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
db.mysql: fix invalid memory access in exec_one for returned rows with NULL fields (#21317)
This commit is contained in:
parent
e235641c29
commit
2192d9b1e5
2 changed files with 11 additions and 10 deletions
|
@ -323,7 +323,7 @@ pub fn (db &DB) exec_one(query string) !Row {
|
|||
|
||||
mut row := Row{}
|
||||
for i in 0 .. num_cols {
|
||||
if unsafe { row_vals == &u8(0) } {
|
||||
if unsafe { row_vals == &u8(0) } || unsafe { row_vals[i] == nil } {
|
||||
row.vals << ''
|
||||
} else {
|
||||
row.vals << mystring(unsafe { &u8(row_vals[i]) })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue