[systemd-devel] [PATCH 08/17] journalctl: print proper IDs with --header

Lennart Poettering lennart at poettering.net
Mon Jun 10 02:09:55 PDT 2013


On Sat, 08.06.13 00:22, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> +               sd_id128_to_string(f->header->file_id, alloca(33)),
> +               sd_id128_to_string(f->header->machine_id, alloca(33)),
> +               sd_id128_to_string(f->header->boot_id, alloca(33)),
> +               sd_id128_to_string(f->header->seqnum_id, alloca(33)),

These invocations are not OK this way. Quoting the man page:

"On many systems alloca() cannot be used inside the list of
 arguments of a function call, because the stack space reserved
 by alloca() would appear on the stack in the middle of the space
 for the function arguments."

This sounds like something we really shouldn't do this way.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list