]> git.puffer.fish Git - matthieu/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)
committerMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Fri, 29 Jan 2021 18:39:24 +0000 (19:39 +0100)
commit8e04b88b8db4b6c154686c0d43ca192f041072b8
treebd67b6e142d1a8ef3958e5a5eee9f5771786a8ec
parentecf497baeda77bfd040818c7bd2ad412cac76d66
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