]> git.puffer.fish Git - mirror/frr.git/commit
ospf6d: Fix LSA formatting inconsistent retvals
authorMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Fri, 29 Jan 2021 18:26:49 +0000 (19:26 +0100)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 16 Feb 2021 18:01:48 +0000 (21:01 +0300)
commit95b8915d0f4de3eae5438632ecd0827061ef48e8
tree5709aa842497b03aa466bcdcf90d90d49ba1db89
parent49d73d8be84dbd23d767697474019165e511786c
ospf6d: Fix LSA formatting inconsistent retvals

Make return values for lh_get_prefix_str LSA handlers consistent, i.e.
return NULL in case of error without having written to the passed buffer
and non-NULL (address of buffer) if a string was written to the buffer.

Previously, it was possible in certain cases (bogus LSAs) to not initialize
(and 0-terminate) the buffer but still return non-NULL, causing the caller
to print random junk.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
ospf6d/ospf6_intra.c