• unknown's avatar
    Bug#28558 UpdateXML called with garbage crashes server · 1da8ea2e
    unknown authored
    Problem: Memory overrun happened in attempts to generate
    error messages (e.g. in case of incorrect XPath syntax).
    Reason: set_if_bigger() was used instead of set_if_smaller().
    Change: replacing wrong set_if_bigger() to set_if_smaller(),
    and making minor additional code clean-ups.
    
    
    mysql-test/r/xml.result:
      Adding test cases for all pieces of code with
      set_if_smaller() followed by my_printf_error().
    mysql-test/t/xml.test:
      Adding test cases for all pieces of code with
      set_if_smaller() followed by my_printf_error().
    sql/item_xmlfunc.cc:
      - fixing incorrect set_if_bigger to set_if_smaller in two places
      - getting read of unnesessary "char context[32]" variable and
        using '%.*s' instead if '%s' in the error format.
    1da8ea2e
xml.test 20.7 KB