[MDEV-19184] Crash in IS_IPV6(_ucs2 0x0031) Created: 2019-04-05  Updated: 2019-04-05  Resolved: 2019-04-05

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.4
Fix Version/s: 10.4.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-274 The data type for IPv6/IPv4 addresses... Closed

 Description   

This query:

SELECT IS_IPV6(_ucs2 0x0031);

crashes with the following stack:

#3  0x00007ffff5e3b2d2 in __GI___assert_fail (assertion=0x15783c4 "cs->mbminlen == 1", 
    file=0x1578368 "/home/bar/maria-git/server.10.4/sql/item_inetfunc.cc", line=473, 
    function=0x1578b20 <Inet6::str_to_ipv6(char const*, unsigned long, charset_info_st const*)::__PRETTY_FUNCTION__> "bool Inet6::str_to_ipv6(const char*, size_t, CHARSET_INFO*)") at assert.c:101
#4  0x0000000000cec24c in Inet6::str_to_ipv6 (this=0x7ffff0bd2f30, str=0x7ffe6c016880 "", str_length=2, 
    cs=0x1f49500 <my_charset_ucs2_general_ci>) at /home/bar/maria-git/server.10.4/sql/item_inetfunc.cc:473
#5  0x0000000000cedeba in Inet6_null::Inet6_null (this=0x7ffff0bd2f30, str=0x7ffe6c016880 "", length=2, 
    cs=0x1f49500 <my_charset_ucs2_general_ci>) at /home/bar/maria-git/server.10.4/sql/item_inetfunc.cc:267
#6  0x0000000000cedf2b in Inet6_null::Inet6_null (this=0x7ffff0bd2f30, str=...) at /home/bar/maria-git/server.10.4/sql/item_inetfunc.cc:270
#7  0x0000000000ced2a3 in Item_func_is_ipv6::val_int (this=0x7ffe6c016948) at /home/bar/maria-git/server.10.4/sql/item_inetfunc.cc:911
#8  0x00000000009e4c47 in Type_handler::Item_send_long (this=0x1e1fda0 <type_handler_bool>, item=0x7ffe6c016948, protocol=0x7ffe6c0010c8, 
    buf=0x7ffff0bd3020) at /home/bar/maria-git/server.10.4/sql/sql_type.cc:6675
#9  0x00000000009f0538 in Type_handler_long::Item_send (this=0x1e1fda0 <type_handler_bool>, item=0x7ffe6c016948, protocol=0x7ffe6c0010c8, 
    buf=0x7ffff0bd3020) at /home/bar/maria-git/server.10.4/sql/sql_type.h:4829
#10 0x00000000006d5baa in Item::send (this=0x7ffe6c016948, protocol=0x7ffe6c0010c8, buffer=0x7ffff0bd3020)
    at /home/bar/maria-git/server.10.4/sql/item.h:1033

So does this query:

SELECT IS_IPV4(_ucs2 0x0031);


Generated at Thu Feb 08 08:49:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.