Skip to content

Commit 6239e06

Browse files
committed
CONC-820 alloca() on invalid metadata from the server
in a valid packet field->length for zero-filled longs cannot exceed 255
1 parent bec34dd commit 6239e06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libmariadb/ma_stmt_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ static void convert_from_long(MYSQL_BIND *r_param, const MYSQL_FIELD *field, lon
674674
uint len;
675675
my_bool zf_truncated= 0;
676676

677-
buffer= alloca(MAX(field->length, 22));
677+
buffer= alloca(MAX(MIN(field->length, 255), 22));
678678
endptr= ma_ll2str(val, buffer, is_unsigned ? 10 : -10);
679679
len= (uint)(endptr - buffer);
680680

0 commit comments

Comments
 (0)