Skip to content

Commit

Permalink
debug12
Browse files Browse the repository at this point in the history
  • Loading branch information
brtnfld committed Dec 11, 2024
1 parent ccb2c0b commit fef7ad6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/H5VLcache_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,13 +1427,21 @@ static herr_t H5VL_cache_ext_str_to_info(const char *str, void **_info) {

LOG_INFO(-1, " storage path: %s", p->H5LS->path);

snprintf(log_buffer, LOG_BUFFER_SIZE, " storage size: %.4f GiB",
int ret = snprintf(log_buffer, LOG_BUFFER_SIZE, " storage size: %.4f GiB",
p->H5LS->mspace_total / 1024. / 1024. / 1024.);
LOG_INFO(-1, "%s", log_buffer);
if (ret < 0 || ret >= LOG_BUFFER_SIZE) {
LOG_WARN(-1, "Log Error when formatting storage size message");
} else {
LOG_INFO(-1, "%s", log_buffer);

Check failure

Code scanning / CodeQL

Unbounded write Critical

This 'call to sprintf' with input from
string read by fgets
may overflow the destination.
}

snprintf(log_buffer, LOG_BUFFER_SIZE, " write buffer size: %.4f GiB",
ret = snprintf(log_buffer, LOG_BUFFER_SIZE, " write buffer size: %.4f GiB",
p->H5LS->write_buffer_size / 1024. / 1024. / 1024.);
LOG_INFO(-1, "%s", log_buffer);
if (ret < 0 || ret >= LOG_BUFFER_SIZE) {
LOG_WARN(-1, "Log Error when formatting write buffer size message");
} else {
LOG_INFO(-1, "%s", log_buffer);

Check failure

Code scanning / CodeQL

Unbounded write Critical

This 'call to sprintf' with input from
string read by fgets
may overflow the destination.
}

LOG_INFO(-1, " storage type: %s", p->H5LS->type);

Expand Down

0 comments on commit fef7ad6

Please sign in to comment.