[systemd-devel] [PATCH 2/5] [use after free] pattern is already freed, so do not dereference it in the error print

David Herrmann dh.herrmann at gmail.com
Thu Sep 11 08:14:50 PDT 2014


Hi

On Wed, Sep 10, 2014 at 11:20 AM,  <philippedeswert at gmail.com> wrote:
> From: Philippe De Swert <philippedeswert at gmail.com>
>
> In case set_consume goes wrong, the pattern name has already been
> freed. So we do not try to print it in the logs, assuming the pattern
> addition print will be printed just before the failure anyway. Found
> with coverity. Fixes: CID#1237798
>
> Signed-off-by: Philippe De Swert <philippedeswert at gmail.com>

Applied!

Thanks
David

> ---
>  src/journal/coredumpctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
> index f5cf85a..4b12ec3 100644
> --- a/src/journal/coredumpctl.c
> +++ b/src/journal/coredumpctl.c
> @@ -110,8 +110,8 @@ static int add_match(Set *set, const char *match) {
>          log_debug("Adding pattern: %s", pattern);
>          r = set_consume(set, pattern);
>          if (r < 0) {
> -                log_error("Failed to add pattern '%s': %s",
> -                          pattern, strerror(-r));
> +                log_error("Failed to add pattern : %s",
> +                          strerror(-r));
>                  goto fail;
>          }
>
> --
> 1.8.3.2
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list