summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage_behavior.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
index 125e083..f68d10d 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
@@ -387,7 +387,12 @@ int dlt_logstorage_open_log_file(DltLogStorageConfigData *config,
return -1;
}
- sprintf(storage_path, "%s/", dev_path);
+ if(snprintf(storage_path, DLT_OFFLINE_LOGSTORAGE_CONFIG_DIR_PATH_LEN,
+ "%s/", dev_path) >= DLT_OFFLINE_LOGSTORAGE_CONFIG_DIR_PATH_LEN)
+ {
+ dlt_log(LOG_ERR, "Mount point path name too long\n");
+ return -1;
+ }
/* check if there are already files stored */
if (config->records == NULL)