[
https://issues.apache.org/jira/browse/DISPATCH-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16966892#comment-16966892
]
ASF GitHub Bot commented on DISPATCH-1467:
------------------------------------------
kgiusti commented on pull request #608: DISPATCH-1467: enable AddressSanitizer
build option (ASAN)
URL: https://github.com/apache/qpid-dispatch/pull/608#discussion_r342199172
##########
File path: router/src/main.c
##########
@@ -179,43 +180,40 @@ static void daemon_process(const char *config_path,
const char *python_pkgdir, b
//
- // If config path is not represented by its full path, then
- // save current path before changing to /
+ // If config path is not a fully qualified path, then construct the
+ // fully qualified path to the config file. This needs to be done
+ // since the daemon will set "/" to its working directory.
//
char *config_path_full = NULL;
if (strncmp("/", config_path, 1)) {
- char *cur_path = NULL;
- size_t path_size = 256;
- int getcwd_error = 0;
- cur_path = (char *) calloc(path_size, sizeof(char));
+ size_t path_size = PATH_MAX;
+ char *cur_path = (char *) calloc(path_size, sizeof(char));
errno = 0;
while (getcwd(cur_path, path_size) == NULL) {
free(cur_path);
- if ( errno != ERANGE ) {
- // If unable to get current directory
- getcwd_error = 1;
- break;
+ if (errno != ERANGE) {
+ // Hard failure - can't recover from this
Review comment:
It is related - the address sanitizer threw a fit on that section of the
code - detected a possible buffer overflow. That change is the fix.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add build option to enable Address Sanitizer build (ASAN)
> ---------------------------------------------------------
>
> Key: DISPATCH-1467
> URL: https://issues.apache.org/jira/browse/DISPATCH-1467
> Project: Qpid Dispatch
> Issue Type: Task
> Components: Tests
> Affects Versions: 1.9.0
> Reporter: Ken Giusti
> Assignee: Ken Giusti
> Priority: Major
> Fix For: 1.10.0
>
>
> Work item.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]