Commit 1044dc11 authored by Jim Meyering's avatar Jim Meyering Committed by Anthony Liguori
Browse files

lm32: avoid buffer overrun



Actually do what the comment says, using pstrcpy NUL-terminate:
strncpy does not always do that.

Signed-off-by: default avatarJim Meyering <meyering@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent a79b5f8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static inline void hwsetup_add_tag(HWSetup *hw, enum hwsetup_tag t)

static inline void hwsetup_add_str(HWSetup *hw, const char *str)
{
    strncpy(hw->ptr, str, 31); /* make sure last byte is zero */
    pstrcpy(hw->ptr, 32, str);
    hw->ptr += 32;
}