)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"16c78a7ab283ae7c7e4710fa03bed12cbdfafa07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4d0b82be_48ad561f","updated":"2024-05-04 09:32:54.000000000","message":"Thanks for the patch, fully agree on the concept.\nNevertheless there are two odd but possible cases that left the variable NULL and by removing all the checks these could cause segmentation fault.\nWhile I don\u0027t think such cases would really happen, either for correct coding and to prevent potential alerts from static checkers/analyzers, I would prefer them to be addressed.","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"1451acd8658a0cc3092de39a30c576c6d3dc6ab4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"62ad94ac_249bb41b","updated":"2024-05-08 15:19:38.000000000","message":"Thanks!","commit_id":"1c7785aac73a9e2aabc85f2ea3c9f3485285d866"}],"src/target/arm_tpiu_swo.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"16c78a7ab283ae7c7e4710fa03bed12cbdfafa07","unresolved":true,"context_lines":[{"line_number":475,"context_line":"\t\t\t\t\t\treturn JIM_ERR;"},{"line_number":476,"context_line":"\t\t\t\t\t}"},{"line_number":477,"context_line":"\t\t\t\t}"},{"line_number":478,"context_line":"\t\t\t\tfree(obj-\u003eout_filename);"},{"line_number":479,"context_line":"\t\t\t\tobj-\u003eout_filename \u003d strdup(s);"},{"line_number":480,"context_line":"\t\t\t\tif (!obj-\u003eout_filename) {"},{"line_number":481,"context_line":"\t\t\t\t\tLOG_ERROR(\"Out of memory\");"},{"line_number":482,"context_line":"\t\t\t\t\treturn JIM_ERR;"},{"line_number":483,"context_line":"\t\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"1acbfad6_a333a316","line":480,"range":{"start_line":478,"start_character":4,"end_line":480,"end_character":29},"updated":"2024-05-04 09:32:54.000000000","message":"By removing all the tests on ```obj-\u003eout_filename``` we now enter in another odd case if this ```strdup()``` fails, as the former value is lost.\nEventually, change here as:\n```\nchar *tmp \u003d strdup(s);\nif (!tmp) {\n\t...;\n}\nfree(obj-\u003eout_filename);\nobj-\u003eout_filename \u003d tmp;\n```","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"1451acd8658a0cc3092de39a30c576c6d3dc6ab4","unresolved":false,"context_lines":[{"line_number":475,"context_line":"\t\t\t\t\t\treturn JIM_ERR;"},{"line_number":476,"context_line":"\t\t\t\t\t}"},{"line_number":477,"context_line":"\t\t\t\t}"},{"line_number":478,"context_line":"\t\t\t\tfree(obj-\u003eout_filename);"},{"line_number":479,"context_line":"\t\t\t\tobj-\u003eout_filename \u003d strdup(s);"},{"line_number":480,"context_line":"\t\t\t\tif (!obj-\u003eout_filename) {"},{"line_number":481,"context_line":"\t\t\t\t\tLOG_ERROR(\"Out of memory\");"},{"line_number":482,"context_line":"\t\t\t\t\treturn JIM_ERR;"},{"line_number":483,"context_line":"\t\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"98e613a9_ccd664d9","line":480,"range":{"start_line":478,"start_character":4,"end_line":480,"end_character":29},"in_reply_to":"0a851e08_ab3eba8b","updated":"2024-05-08 15:19:38.000000000","message":"Done","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"14e090b481c7e7c9e3b85cd5c2928ad9cdb62d38","unresolved":true,"context_lines":[{"line_number":475,"context_line":"\t\t\t\t\t\treturn JIM_ERR;"},{"line_number":476,"context_line":"\t\t\t\t\t}"},{"line_number":477,"context_line":"\t\t\t\t}"},{"line_number":478,"context_line":"\t\t\t\tfree(obj-\u003eout_filename);"},{"line_number":479,"context_line":"\t\t\t\tobj-\u003eout_filename \u003d strdup(s);"},{"line_number":480,"context_line":"\t\t\t\tif (!obj-\u003eout_filename) {"},{"line_number":481,"context_line":"\t\t\t\t\tLOG_ERROR(\"Out of memory\");"},{"line_number":482,"context_line":"\t\t\t\t\treturn JIM_ERR;"},{"line_number":483,"context_line":"\t\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"0a851e08_ab3eba8b","line":480,"range":{"start_line":478,"start_character":4,"end_line":480,"end_character":29},"in_reply_to":"1acbfad6_a333a316","updated":"2024-05-06 19:59:59.000000000","message":"Oh, you\u0027re right. I will fix this, thanks!","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"16c78a7ab283ae7c7e4710fa03bed12cbdfafa07","unresolved":true,"context_lines":[{"line_number":956,"context_line":"\tadiv5_mem_ap_spot_init(\u0026obj-\u003espot);"},{"line_number":957,"context_line":"\tobj-\u003espot.base \u003d TPIU_SWO_DEFAULT_BASE;"},{"line_number":958,"context_line":"\tobj-\u003eport_width \u003d 1;"},{"line_number":959,"context_line":"\tobj-\u003eout_filename \u003d strdup(\"external\");"},{"line_number":960,"context_line":""},{"line_number":961,"context_line":"\tJim_Obj *n;"},{"line_number":962,"context_line":"\tjim_getopt_obj(\u0026goi, \u0026n);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bf69fa26_f414a2ea","line":959,"updated":"2024-05-04 09:32:54.000000000","message":"Even if odd, strdup() can fail, returning NULL\nThis would later cause segmentation fault because you have removed the tests on !out_filename\nPlease check for the return value","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"1451acd8658a0cc3092de39a30c576c6d3dc6ab4","unresolved":false,"context_lines":[{"line_number":956,"context_line":"\tadiv5_mem_ap_spot_init(\u0026obj-\u003espot);"},{"line_number":957,"context_line":"\tobj-\u003espot.base \u003d TPIU_SWO_DEFAULT_BASE;"},{"line_number":958,"context_line":"\tobj-\u003eport_width \u003d 1;"},{"line_number":959,"context_line":"\tobj-\u003eout_filename \u003d strdup(\"external\");"},{"line_number":960,"context_line":""},{"line_number":961,"context_line":"\tJim_Obj *n;"},{"line_number":962,"context_line":"\tjim_getopt_obj(\u0026goi, \u0026n);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"8ff4e743_567f3215","line":959,"in_reply_to":"bf69fa26_f414a2ea","updated":"2024-05-08 15:19:38.000000000","message":"Done","commit_id":"2c9c2bdf790fc5a34b43b381be5ba16f37504665"}]}
