Skip to content

Commit aa9c14a

Browse files
Tor Didriksenzmur
authored andcommitted
Bug#37039383 Backport Bug#36593265 MySQL server heap-buffer-overflow in strlen
When converting a MySQL String to an std::string, use {ptr(), length()} rather than strlen(). Change-Id: Ie59965ecccf9846cf5c18b90b572328263c1cefa
1 parent f6f24ec commit aa9c14a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/item_strfunc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -436,7 +436,7 @@ class kdf_argument {
436436
*error_generated = TRUE;
437437
return FALSE;
438438
}
439-
kdf_option = kdf_option_value->ptr();
439+
kdf_option = string(kdf_option_value->ptr(), kdf_option_value->length());
440440
return TRUE;
441441
}
442442

0 commit comments

Comments
 (0)