From c6f67c6fd9140379eab070ffb1e2f2f9270d8fd5 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Tue, 24 Jun 2008 21:05:56 +0500 Subject: [PATCH] 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. --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index b373b9125a0..c8d5522628d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -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)