[dm-devel] [PATCH 1/2] libmultipath: print.c: make sure lines are 0-terminated
Johannes Thumshirn
jthumshirn at suse.de
Wed May 17 14:07:42 UTC 2017
Hi Martin,
On 05/17/2017 03:54 PM, Martin Wilck wrote:
> Under certain conditions, the output of "multipath -ll" or
> "multipathd show topology", or the multipathd logs, may
> contain garbage characters. Fix that by making sure that
> the strings are always properly zero-terminated.
>
> Note 1: The way this is coded, the previously written
> character is overwritten by the newline. That behavior is
> unchanged by this patch. I didn't want to fuzz with the
> carefully crafted print.c code more than necessary at
> this point.
>
> Note 2: The condition (c <= line + len - 1) is equivalent to
> (TAIL >= 0). It should always hold the way ENDLINE is called
> after PRINT and PAD in print.c, and is only added as an
> additional safeguard, e.g. against future code changes.
^^ Missing S-o-b
--
Johannes Thumshirn Storage
jthumshirn at suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
More information about the dm-devel
mailing list