mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
dict0dict.c:
Fix bug introduced in 4.0.13 and reported by Emic: if a CREATE TABLE ended in a comment, a memory overrun could happen innobase/dict/dict0dict.c: Fix bug introduced in 4.0.13 and reported by Emic: if a CREATE TABLE ended in a comment, a memory overrun could happen
This commit is contained in:
parent
17a6d749d4
commit
30b751f8a6
1 changed files with 6 additions and 3 deletions
|
|
@ -2405,9 +2405,12 @@ dict_strip_comments(
|
|||
ptr = str;
|
||||
|
||||
for (;;) {
|
||||
scan_more:
|
||||
if (*sptr == '\0') {
|
||||
*ptr = '\0';
|
||||
|
||||
ut_a(ptr <= str + strlen(sql_string));
|
||||
|
||||
return(str);
|
||||
}
|
||||
|
||||
|
|
@ -2421,7 +2424,7 @@ dict_strip_comments(
|
|||
|| *sptr == (char)0x0D
|
||||
|| *sptr == '\0') {
|
||||
|
||||
break;
|
||||
goto scan_more;
|
||||
}
|
||||
|
||||
sptr++;
|
||||
|
|
@ -2435,12 +2438,12 @@ dict_strip_comments(
|
|||
|
||||
sptr += 2;
|
||||
|
||||
break;
|
||||
goto scan_more;
|
||||
}
|
||||
|
||||
if (*sptr == '\0') {
|
||||
|
||||
break;
|
||||
goto scan_more;
|
||||
}
|
||||
|
||||
sptr++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue