diff options
author | michael-methner <mmethner@de.adit-jv.com> | 2022-10-11 04:53:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 09:53:12 +0700 |
commit | 154d225b934de70387533f3dfaf5d449a580c28b (patch) | |
tree | f2601b9fe713bb01f047edf67328b9fd1dd8dead /src/lib | |
parent | e961a8f7c0f655a4379c8c6bcf745f89604c453f (diff) | |
download | DLT-daemon-154d225b934de70387533f3dfaf5d449a580c28b.tar.gz |
Avoid memory corruption behind buffer wp in function dlt_getloginfo_conv_ascii_to_id (#411)
* Avoid memory corruption behind buffer wp in function dlt_getloginfo_conv_ascii_to_id
- Introduced new function dlt_getloginfo_conv_ascii_to_string for '\0' terminated strings
- Avoid printing garbage characters in dlt-control after APID and CTID (which are not null terminated anymore)
- Added unit test for dlt_client_parse_get_log_info_resp_text and dlt_getloginfo_conv_ascii_to_string
- Use dlt_getloginfo_conv_ascii_to_string to get '\0' terminated for app_description and context_description
Signed-off-by: Michael Methner <mmethner@de.adit-jv.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/dlt_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dlt_client.c b/src/lib/dlt_client.c index 245ebef..c032fd4 100644 --- a/src/lib/dlt_client.c +++ b/src/lib/dlt_client.c @@ -1332,7 +1332,7 @@ DltReturnValue dlt_client_parse_get_log_info_resp_text(DltServiceGetLogInfoRespo return DLT_RETURN_ERROR; } - dlt_getloginfo_conv_ascii_to_id(rp, + dlt_getloginfo_conv_ascii_to_string(rp, &rp_count, con->context_description, con->len_context_description); @@ -1352,7 +1352,7 @@ DltReturnValue dlt_client_parse_get_log_info_resp_text(DltServiceGetLogInfoRespo return DLT_RETURN_ERROR; } - dlt_getloginfo_conv_ascii_to_id(rp, + dlt_getloginfo_conv_ascii_to_string(rp, &rp_count, app->app_description, app->len_app_description); |