From 45f739bd9d4a98545ca2d7df7f13923e2d31faaa Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 14 Jun 2013 16:38:27 +0200 Subject: Bug#14834378 ADDRESSSANITIZER BUG IN FILENAME_TO_TABLENAME Backport to 5.5 sql/sql_table.cc: gcc asan crashes in filename_to_tablename() on this: memcmp("-@", "#sql", 4) during loading of the innobase plugin --- strings/ctype-utf8.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'strings/ctype-utf8.c') diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 343884827e1..4976a9cf31a 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -4391,6 +4391,8 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), return MY_CS_TOOSMALL3; byte1= s[1]; + if (byte1 == 0) + return MY_CS_ILSEQ; /* avoid possible out-of-bounds read */ byte2= s[2]; if (byte1 >= 0x30 && byte1 <= 0x7F && -- cgit v1.2.1