[Tarantool-patches] [PATCH 2/6] sql: fix possible null dereference in sql_expr_coll()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Dec 6 02:59:29 MSK 2019


On 05/12/2019 12:40, Nikita Pettik wrote:
> On 28 Nov 23:42, Vladislav Shpilevoy wrote:
>> Thanks for the patch!
>>
>> Is it possible to test this?
> 
> As a pure test case - I've failed to come up with it.
> But the next patch (which adds collation to metadata) definitely fails
> without this fix (when TRIM() or REPLACE() are called without args).

Why does not it fail right after finding that there are no
arguments? TRIM looks strange, but REPLACE expects 3 arguments.

> I can dive into details, but I guess it's not so important here (since
> this is obviously buggy place). 

Is it? As I pointed above, maybe the bug is really in another
place? I see, that REPLACE checks argument count. But somewhy
too late:

    tarantool> box.execute('SELECT REPLACE()')
    ---
    - null
    - 'Wrong number of arguments is passed to REPLACE(): expected 3, got 0'
    ...

> If you want further investigation, let me
> know and I will do it.

Yeah. I think we need to understand the bug before fixing
it.


More information about the Tarantool-patches mailing list