Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit b783878

Browse files
[[ Bug 14972 ]] Avoid to write at a random place in memory when opening a DB driver
1 parent d94f0fd commit b783878

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

revdb/src/iossupport.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ extern "C" void *resolve_symbol(void *, const char *);
182182
DATABASEREC *DoLoadDatabaseDriver(const char *p_path)
183183
{
184184
char *t_filename;
185-
t_filename = (char *)malloc((sizeof(char) * strlen(p_path)) + 4);
185+
// SN-2015-05-12: [[ Bug 14972 ]] We don't want to write somewhere we don't
186+
// own the memory
187+
t_filename = (char *)malloc((sizeof(char) * strlen(p_path)) + 7);
186188
sprintf(t_filename, "%s.dylib", p_path);
187189

188190
#if defined(__i386__) || defined(__x86_64__)

0 commit comments

Comments
 (0)