Skip to content

TCF Agent: [Bug ID:582929] Fix crash in pathmap

In the function "map_file_name" (tcf-agent/agent/tcf/services/pathmap.c:map_file_name), when the length of the source canonical file name is zero (pathmap.c:389; canonical file name for PathMapRule.src) and the last character of the destination path is separator (PathMapRule.dst), subtraction from unsigned zero occurs (pathmap.c:412). This then causes an access violation in the tmp_strdup2 function (tcf-agent/agent/tcf/framework/myalloc.c:165). To fix this problem, a check on zero before subtraction was added.

Scenario where this could happen:

 Source path: "./"

 Destination path: "/path/to/dest/" (with trailing "/")
Edited by Maxim Smirnov

Merge request reports