2680 Vladislav Vaintroub 2008-09-16
Bug#35987 - post-review fix
Correct usage of strncat() in get_symbol_path()
3rd parameter to strncat is changed to be count of
remaining bytes in the output buffer minus 1.
modified:
sql/stacktrace.c
2679 Patrick Crews 2008-09-15
Bug#37938 Test "mysqldump" lacks various INSERT statements / values
Moved fix for this bug to 5.0 as other mysqldump bugs seem tied to concurrent_insert being on
Setting concurrent_insert off during this test as INSERTs weren't being
completely processed before the calls to mysqldump, resulting in failing tests.
Altered .test file to turn concurrent_insert off during the test and to restore it
to whatever the value was at the start of the test when complete.
Re-recorded .result file to account for changes to variables in the test.
modified:
mysql-test/r/mysqldump.result
mysql-test/t/mysqldump.test
=== modified file 'sql/stacktrace.c'
--- a/sql/stacktrace.c 2008-09-15 12:58:32 +0000
+++ b/sql/stacktrace.c 2008-09-16 11:16:41 +0000
@@ -391,7 +391,12 @@ static void get_symbol_path(char *path,
if (!strstr(path, module_dir))
{
- strncat(path, module_dir, size);
+ size_t dir_len = strlen(module_dir);
+ if (size > dir_len)
+ {
+ strncat(path, module_dir, size-1);
+ size -= dir_len;
+ }
}
}
CloseHandle(hSnap);
@@ -399,9 +404,9 @@ static void get_symbol_path(char *path,
/* Add _NT_SYMBOL_PATH, if present. */
envvar= getenv("_NT_SYMBOL_PATH");
- if(envvar)
+ if(envvar && size)
{
- strncat(path, envvar, size);
+ strncat(path, envvar, size-1);
}
}
@@ -423,7 +428,7 @@ void print_stacktrace(gptr unused1, ulon
int i;
CONTEXT context;
STACKFRAME64 frame={0};
- static char symbol_path[MAX_SYMBOL_PATH+1];
+ static char symbol_path[MAX_SYMBOL_PATH];
if(!exception_ptrs || !init_dbghelp_functions())
return;
@@ -432,7 +437,7 @@ void print_stacktrace(gptr unused1, ulon
context = *(exception_ptrs->ContextRecord);
/*Initialize symbols.*/
pSymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG);
- get_symbol_path(symbol_path, MAX_SYMBOL_PATH);
+ get_symbol_path(symbol_path, sizeof(symbol_path));
pSymInitialize(hProcess, symbol_path, TRUE);
/*Prepare stackframe for the first StackWalk64 call*/
| Thread |
|---|
| • bzr push into mysql-5.1-bugteam branch (vvaintroub:2679 to 2680) Bug#35987 | Vladislav Vaintroub | 16 Sep |