Home
last modified time | relevance | path

Searched hist:de6a5cb90c15fcdd05dd9bfd4bde3c8a857dd781 (Results 1 – 1 of 1) sorted by relevance

/haiku/src/apps/cortex/MediaRoutingView/
H A DMediaNodePanel.cppde6a5cb90c15fcdd05dd9bfd4bde3c8a857dd781 Fri Jul 31 22:50:09 UTC 2020 Michael Lotz <mmlr@mlotz.ch> Cortex: Fix buffer overflows in label truncation.

The label to be truncated was copied into a fixed width buffer without
taking the null byte into account which would make
BFont::GetTruncatedStrings() read out of bounds when the name got long
enough. The output strings were also not allocated with the required
extra space for the ellipsis which would possibly have caused the
output to overflow.

Since the goal is to truncate a single string, remove the entire
temporary extra allocations and simplify to use BFont::TruncateString()
directly, which avoids both problems by being BString based.

Change-Id: Ib57430faf6f706c705497191000ee9686441857e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3116
Reviewed-by: waddlesplash <waddlesplash@gmail.com>