Commit 748a9b1a authored by Gleb Shchepa's avatar Gleb Shchepa
Browse files

back-port from 5.1.

Bug#35480: BOM detection code crashes mysql CLI with zero-sized input
      
MySQL client crashed if no input was passed to it.
parent 9ffe2c02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive)
        the very beginning of a text file when
        you save the file using "Unicode UTF-8" format.
      */
      if (!line_number &&
      if (line && !line_number &&
           (uchar) line[0] == 0xEF &&
           (uchar) line[1] == 0xBB &&
           (uchar) line[2] == 0xBF)