Skip to content

Commit

Permalink
Merge pull request #4279 from mihalicyn/setproctitle_fix_fmt_spec
Browse files Browse the repository at this point in the history
initutils: use PRIu64 for uint64_t in setproctitle
  • Loading branch information
stgraber committed Feb 16, 2023
2 parents 2d3dab7 + 304bf58 commit 0b286bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lxc/initutils.c
Expand Up @@ -224,7 +224,7 @@ int setproctitle(char *title)
* PR_SET_MM_MAP requires us to set it all at once, so we have to
* figure it out anyway.
*/
unsigned long start_data, end_data, start_brk, start_code, end_code,
uint64_t start_data, end_data, start_brk, start_code, end_code,
start_stack, arg_start, arg_end, env_start, env_end, brk_val;
struct prctl_mm_map prctl_map;

Expand Down Expand Up @@ -253,7 +253,7 @@ int setproctitle(char *title)
if (!buf_ptr)
return -1;

i = sscanf(buf_ptr, "%lu %lu %lu", &start_code, &end_code, &start_stack);
i = sscanf(buf_ptr, "%" PRIu64 " %" PRIu64 " %" PRIu64, &start_code, &end_code, &start_stack);
if (i != 3)
return -1;

Expand All @@ -267,7 +267,7 @@ int setproctitle(char *title)
if (!buf_ptr)
return -1;

i = sscanf(buf_ptr, "%lu %lu %lu %*u %*u %lu %lu", &start_data,
i = sscanf(buf_ptr, "%" PRIu64 " %" PRIu64 " %" PRIu64 " %*u %*u %" PRIu64 " %" PRIu64, &start_data,
&end_data, &start_brk, &env_start, &env_end);
if (i != 5)
return -1;
Expand Down

0 comments on commit 0b286bd

Please sign in to comment.