-
Notifications
You must be signed in to change notification settings - Fork 844
LogFilter: fix NULL termination check #8603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc-12 generated the following warning:
proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
477 | if (new_param && (new_param + 1)) {
| ~~~~~~~~~~~^~~~
That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
is NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.
randall
approved these changes
Jan 13, 2022
zwoop
pushed a commit
that referenced
this pull request
Jan 18, 2022
gcc-12 generated the following warning:
proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
477 | if (new_param && (new_param + 1)) {
| ~~~~~~~~~~~^~~~
That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
is NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.
(cherry picked from commit 9966c9b)
Contributor
|
Cherry-picked to v9.2.x |
moonchen
pushed a commit
to moonchen/trafficserver
that referenced
this pull request
Mar 17, 2022
* asf/9.2.x: Updated ChangeLog TSHttpTxnCacheLookupStatusGet: handle cannot respond cases (apache#8545) Update to Proxy Verifier version v2.3.0 (apache#8608) Don't use Http1ClientTransaction as an event handler (apache#8609) Eliminate erroneous self-loop error on transparent mode (apache#8586) Clean up of next hop HostRecord class. (apache#8585) Propagate accept options to HTTP/2 (apache#8594) add --with-mimalloc option (apache#8233) Fix transparent mode documentation (apache#8593) Docs: Slack instead of irc (apache#8599) LogFilter: fix NULL termination check (apache#8603) Fixes a scoping bug that leads to "sticky" weights (apache#8606)
Contributor
|
@zwoop or whoever's doing 9.1.x releases, we need this for 9.1.x to build on Fedora. Or is 9.1.x deprecated in favor of 9.2.x? https://ci.trafficserver.apache.org/job/Github_Builds/job/fedora/997/console |
ywkaras
pushed a commit
to ywkaras/trafficserver
that referenced
this pull request
Jun 15, 2022
gcc-12 generated the following warning:
proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
477 | if (new_param && (new_param + 1)) {
| ~~~~~~~~~~~^~~~
That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
is NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Oct 11, 2022
gcc-12 generated the following warning:
proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
477 | if (new_param && (new_param + 1)) {
| ~~~~~~~~~~~^~~~
That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
is NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.
(cherry picked from commit 9966c9b)
bryancall
pushed a commit
that referenced
this pull request
Oct 11, 2022
* Fix Clang 13.0.1 and GCC 12.0.1 Compiler Warnings (#8690) This cherry-picks two commits from master: Fix Clang 13.0.1 compiler warnings (#8685) This fixes a couple compiler warnings raised by Clang 13.0.1. (cherry picked from commit 96ce993) Fix warnings from GCC 12.0.1 (#8684) This patch fixes warnings generated by GCC 12.0.1. The warnings involved the use of the deprecated std::binary_function, std::unary_function, and std::iterator interfaces. The use of these was considered more confusing than explicitly declaring the associated types. Therefore this patch replaces the use of these deprecated interfaces with the declaration of the associated types. (cherry picked from commit 0ae34d4) (cherry picked from commit 1a37ae9) * LogFilter: fix NULL termination check (#8603) gcc-12 generated the following warning: proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)': proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address] 477 | if (new_param && (new_param + 1)) { | ~~~~~~~~~~~^~~~ That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param is NULL because 1 will be added to it. The intention was to check for the string's null terminator at the offset, which is done via a dereference. (cherry picked from commit 9966c9b)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gcc-12 generated the following warning:
proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
477 | if (new_param && (new_param + 1)) {
| ~~~~~~~~~~~^~~~
That is indeed a bug.
new_param + 1will always be non-NULL even if new_paramis NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.