mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
Reword misleading message in stack trace when parameter buffer is full.
The prior message stated that there had been a buffer overrun which is not true since the code prevents that. In fact, this message means the parameter buffer filled while building the parameter list. Rather than display a partial list we output this message instead. Also remove !!! which by convention we use as a marker for code that needs attention before it can be committed to master.
This commit is contained in:
parent
8c7e97a369
commit
14d2f8b86c
@ -146,6 +146,10 @@
|
||||
<p>Rename <code>CipherError</code> to <code>CryptoError</code>.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Reword misleading message in stack trace when parameter buffer is full.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Add logging macros for <code>TimeMSec</code> type.</p>
|
||||
</release-item>
|
||||
|
@ -169,7 +169,7 @@ stackTraceParamIdx(int stackIdx)
|
||||
if (data->paramLog)
|
||||
{
|
||||
if (data->paramOverflow)
|
||||
return "!!! buffer overflow - parameters not available !!!";
|
||||
return "buffer full - parameters not available";
|
||||
|
||||
if (data->paramSize == 0)
|
||||
return "void";
|
||||
|
@ -148,14 +148,14 @@ testRun(void)
|
||||
stackTrace[stackSize - 1].param += 1;
|
||||
stackTrace[stackSize - 1].paramSize = 0;
|
||||
stackTraceParamAdd((size_t)snprintf(stackTraceParamBuffer("param1"), STACK_TRACE_PARAM_MAX, "value1"));
|
||||
assert(strcmp(stackTraceParam(), "!!! buffer overflow - parameters not available !!!") == 0);
|
||||
assert(strcmp(stackTraceParam(), "buffer full - parameters not available") == 0);
|
||||
|
||||
stackTraceToZ(buffer, sizeof(buffer), "file4.c", "function4", 99);
|
||||
|
||||
#ifdef WITH_BACKTRACE
|
||||
TEST_RESULT_STR(
|
||||
buffer,
|
||||
"file4:function4:99:(!!! buffer overflow - parameters not available !!!)\n"
|
||||
"file4:function4:99:(buffer full - parameters not available)\n"
|
||||
"file3:function3:7777:(param1: value1, param2: value2)\n"
|
||||
"file2:function2:7777:(param1: value1)\n"
|
||||
"file1:function2:7777:(debug log level required for parameters)\n"
|
||||
@ -164,7 +164,7 @@ testRun(void)
|
||||
#else
|
||||
TEST_RESULT_STR(
|
||||
buffer,
|
||||
"file4:function4:99:(!!! buffer overflow - parameters not available !!!)\n"
|
||||
"file4:function4:99:(buffer full - parameters not available)\n"
|
||||
"file3:function3:(param1: value1, param2: value2)\n"
|
||||
"file2:function2:(param1: value1)\n"
|
||||
"file1:function2:(debug log level required for parameters)\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user