lkml.org 
[lkml]   [2024]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] PCI: mt7621: Fix possible string truncation in snprintf
    Hello,

    > The following warning appears when driver is compiled with W=1.
    >
    > CC drivers/pci/controller/pcie-mt7621.o
    > drivers/pci/controller/pcie-mt7621.c: In function ‘mt7621_pcie_probe’:
    > drivers/pci/controller/pcie-mt7621.c:228:49: error: ‘snprintf’ output may
    > be truncated before the last format character [-Werror=format-truncation=]
    > 228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
    > | ^
    > drivers/pci/controller/pcie-mt7621.c:228:9: note: ‘snprintf’ output between
    > 10 and 11 bytes into a destination of size 10
    > 228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
    > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    >
    > Clean this up increasing destination buffer one byte.

    Applied to controller/mt7621, thank you!

    [1/1] PCI: mt7621: Fix string truncation in mt7621_pcie_parse_port()
    https://git.kernel.org/pci/pci/c/fd6eb49a84a8

    Krzysztof

    \
     
     \ /
      Last update: 2024-05-27 18:30    [W:4.449 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site