1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

More coverity fixes

This commit is contained in:
Georg Richter
2018-07-13 12:30:13 +02:00
parent 77fc17b7aa
commit c95f86e882
11 changed files with 121 additions and 25 deletions

View File

@@ -332,7 +332,7 @@ static my_bool type_and_offset_store_num(uchar *place, size_t offset_size,
{
ulong val = (((ulong) offset) << 3) | (type - 1);
DBUG_ASSERT(type != DYN_COL_NULL);
DBUG_ASSERT(((type - 1) & (~7)) == 0); /* fit in 3 bits */
DBUG_ASSERT(((type - 1) & (~0xf)) == 0); /* fit in 4 bits */
DBUG_ASSERT(offset_size >= 1 && offset_size <= 4);
/* Index entry starts with column number; jump over it */
@@ -3889,10 +3889,9 @@ mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
return ER_DYNCOL_RESOURCE;
}
if (quote)
rc= ma_dynstr_append_mem(str, &quote, 1);
rc= ma_dynstr_append_mem(str, from, len);
if (quote)
rc= ma_dynstr_append_mem(str, &quote, 1);
rc= ma_dynstr_append_quoted(str, from, len, quote);
else
rc= ma_dynstr_append_mem(str, from, len);
if (alloc)
free(alloc);
if (rc)
@@ -3948,7 +3947,7 @@ mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val)
break;
case DYN_COL_UINT:
*ll= (longlong)val->x.ulong_value;
if (val->x.ulong_value > ULONGLONG_MAX)
if (*ll > (longlong)ULONGLONG_MAX)
rc= ER_DYNCOL_TRUNCATED;
break;
case DYN_COL_DOUBLE: