1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-10 01:02:57 +03:00

BUG#29597896 - NULL POINTER DEREFERENCE IN LIBMYSQL

CONC version of server commit e8e67bd4a4c
This commit is contained in:
Sergei Golubchik
2020-05-04 09:13:08 +02:00
parent 2d81c70a41
commit ca8f94f727

View File

@@ -870,18 +870,13 @@ unpack_fields(const MYSQL *mysql,
for (i=0; i < field_count; i++) for (i=0; i < field_count; i++)
{ {
switch(row->data[i][0]) { uint length= (uint)(row->data[i+1] - row->data[i] - 1);
case 0: if (!row->data[i] && row->data[i][length])
*(char **)(((char *)field) + rset_field_offsets[i*2])= ma_strdup_root(alloc, ""); goto error;
*(unsigned int *)(((char *)field) + rset_field_offsets[i*2+1])= 0;
break; *(char **)(((char *)field) + rset_field_offsets[i*2])=
default: ma_strdup_root(alloc, (char *)row->data[i]);
*(char **)(((char *)field) + rset_field_offsets[i*2])= *(unsigned int *)(((char *)field) + rset_field_offsets[i*2+1])= length;
ma_strdup_root(alloc, (char *)row->data[i]);
*(unsigned int *)(((char *)field) + rset_field_offsets[i*2+1])=
(uint)(row->data[i+1] - row->data[i] - 1);
break;
}
} }
field->extension= NULL; field->extension= NULL;