Skip to content

Commit 90a3e36

Browse files
committed
Bug#35982564 Heap buffer overflow on NDB_SHARE_KEY DBUG_DUMP
Problem: Running an ASAN build with DBUG_TRACE calls (--debug), a heap buffer overflow is detected on NDB_SHARE::create_key(). Analysis: On NDB_SHARE::create_key(), the DBUG_DUMP of the `m_buffer` field of NDB_SHARE_KEY is given with the size `size` which amounts to sizeof(NDB_SHARE_KEY) + buffer_size. Hence, DBUG_DUMP is called with sizeof(NDB_SHARE_KEY) extra bytes, caught by ASAN build. Solution: Since DBUG_DUMP is not necessary, because a DBUG_PRINT of the buffer is already present in the lines before, then it is removed. Change-Id: I92c17fb16b39d19a896a500b8ab1956addc16015
1 parent b19f44e commit 90a3e36

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

sql/ndb_share.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ NDB_SHARE::create_key(const char *new_key)
136136
db_name_buf, (unsigned long)db_name_len));
137137
DBUG_PRINT("info", ("table_name: '%s', %lu", table_name_buf,
138138
(unsigned long)table_name_len));
139-
DBUG_DUMP("NDB_SHARE_KEY: ", (const uchar*)allocated_key->m_buffer, size);
140139

141140
return allocated_key;
142141
}

0 commit comments

Comments
 (0)