You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2021/06/23 13:55:03 UTC

[GitHub] [celix] dhbfischer commented on a change in pull request #351: Refactors http_admin to use gtest and fixes a segfault issue

dhbfischer commented on a change in pull request #351:
URL: https://github.com/apache/celix/pull/351#discussion_r657125485



##########
File path: bundles/http_admin/http_admin/src/service_tree.c
##########
@@ -307,8 +307,8 @@ service_tree_node_t *findServiceNodeInTree(service_tree_t *svc_tree, const char
 
         char *uri_token = strtok_r(uri_cpy, "/", &save_ptr);
         //Check for horizontal matches for the first token
-        while(current != NULL) {
-            if(strcmp(current->svc_data->sub_uri, uri_token) == 0){
+        while (current != NULL) {
+            if (uri_token != NULL && strcmp(current->svc_data->sub_uri, uri_token) == 0){

Review comment:
       I think if (uri_token == NULL) a deadlock will occur, you have to catch this case too. The uri_token will stay NULL and the current pointer will not change to NULL, it should be enough to change the current to NULL. 




-- 
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:
users@infra.apache.org