[systemd-devel] [PATCH] Set error code on failure

David Herrmann dh.herrmann at gmail.com
Thu Nov 27 07:40:36 PST 2014


Hi

On Tue, Nov 18, 2014 at 6:40 AM, Stanisław Pitucha <viraptor at gmail.com> wrote:
> Set the error code in case of incorrect name. This prevents continuing
> and failing an assert(name) later on.
> ---
>  src/resolve/resolved-dns-packet.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Looks good, applied!

Thanks
David

> diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
> index 7f76285..3948f96 100644
> --- a/src/resolve/resolved-dns-packet.c
> +++ b/src/resolve/resolved-dns-packet.c
> @@ -927,8 +927,10 @@ int dns_packet_read_name(DnsPacket *p, char **_ret,
>
>                          earliest_compression_pointer = ptr;
>                          p->rindex = ptr;
> -                } else
> +                } else {
> +                        r = -EBADMSG;
>                          goto fail;
> +                }
>          }
>
>          if (!GREEDY_REALLOC(ret, allocated, n + 1)) {
> --
> 2.1.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