• Georgi Kodinov's avatar
    Bug #13708485: malformed resultset packet crashes client · 428ff7f8
    Georgi Kodinov authored
    Several fixes :
    
    * sql-common/client.c
    Added a validity check of the fields metadata packet sent 
    by the server.
    Now libmysql will check if the length of the data sent by
    the server matches what's expected by the protocol before
    using the data.
    
    * client/mysqltest.cc
    Fixed the error handling code in mysqltest to avoid sending
    new commands when the reading the result set failed (and 
    there are unread data in the pipe).
    
    * sql_common.h + libmysql/libmysql.c + sql-common/client.c
    unpack_fields() now generates a proper error when it fails.
    Added a new argument to this function to support the error 
    generation.
    
    * sql/protocol.cc
    Added a debug trigger to cause the server to send a NULL
    insted of the packet expected by the client for testing 
    purposes.
    428ff7f8
sql_common.h 2.01 KB