mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
..passed as argument 2, which is declared to never be null (dynstr_append_mem). dynstr_append_mem, uses memcpy to append to the string which in the glibc library is declared to not take null string as the src. Defensively we declare dynstr_append_mem to not take a null argument too. mariadb-test, to prevent it calling dynstr_append_mem with a null mtr variable value, one that hasn't been initialized, we return an error if the value is null. The result of this is the $6 in the test case is never assigned a value and would error. With this resolved, strchr, if the string isn't found, a null pointer is returned. UBSAN will complain both about incrementing a pointer beyond the boundary, and also incrementing if it is null.