Connector/ODBC: SqlwcsOctetLen sizes UTF-16 with a byte-oriented helper, reading past the caller's buffer and sending client memory to the server
该报告还没有中文解读。
原文摘录
摘自原文(9792 字符中的一小部分)
`SqlwcsOctetLen` (`driver/ma_platform_posix.cpp:121`) sizes a UTF-16 string by calling Connector/C's `mb_charlen`. That helper is byte-oriented: its `UTF16_HIGH_HEAD(x)` macro casts the argument to `uchar`, so it inspects only the low byte. `SqlwcsOctetLen` hands it a whole `SQLWCHAR`, so every …
原文中的代码
/* CharLen < 0 - treat as NTS */
SQLINTEGER SqlwcsOctetLen(const SQLWCHAR *str, SQLINTEGER *CharLen)
{
SQLINTEGER result= 0, inChars= *CharLen;
if (str)
{
while (inChars > 0 || (inChars < 0 && *str))
{
result+= DmUnicodeCs->mb_charlen(*str);
--inChars;
str+= …默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 MariaDB 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @fg0x0 · 版权归作者与 MariaDB 所有