Skip to content
Snippets Groups Projects
Commit 55ce5d4b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'logger_fix_sanitizer' into 'master'

Logger: fix sanitizer

See merge request !973
parents bc9f1726 8bfcd347
No related branches found
No related tags found
1 merge request!973Logger: fix sanitizer
...@@ -154,6 +154,9 @@ void header_read(struct header *h, struct logger_logfile *log) { ...@@ -154,6 +154,9 @@ void header_read(struct header *h, struct logger_logfile *log) {
/* Allocate the masks memory. */ /* Allocate the masks memory. */
h->masks = malloc(sizeof(struct mask_data) * h->masks_count); h->masks = malloc(sizeof(struct mask_data) * h->masks_count);
if (h->masks == NULL) {
error("Failed to allocate the memory for the masks.");
}
/* Loop over all masks. */ /* Loop over all masks. */
h->timestamp_mask = 0; h->timestamp_mask = 0;
......
...@@ -217,7 +217,7 @@ void logger_write_index_file(struct logger_writer* log, struct engine* e) { ...@@ -217,7 +217,7 @@ void logger_write_index_file(struct logger_writer* log, struct engine* e) {
size_t cur_pos = ftell(f); size_t cur_pos = ftell(f);
size_t d_align = ((cur_pos + 7) & ~7) - cur_pos; size_t d_align = ((cur_pos + 7) & ~7) - cur_pos;
if (d_align > 0) { if (d_align > 0) {
int tmp = 0; long int tmp = 0;
/* Fill the memory with garbage */ /* Fill the memory with garbage */
fwrite(&tmp, d_align, 1, f); fwrite(&tmp, d_align, 1, f);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment