Hi Nathan,> This does not appear to be a false positive but what was the intent > here? Should the local name variables increase their length or should > the buffer length be reduced?You're right, the local name variables and snprintf argument don't match. Thanks for noticing. I think that we should increase the name variables to be SNET_NAME_SIZE bytes long. How should I proceed from here? Should I create a new version for this patch, or should I fix it in a follow up patch? Thanks, Alvaro
On Tue, Dec 20, 2022, at 17:46, Alvaro Karsz wrote:> Hi Nathan, > >> This does not appear to be a false positive but what was the intent >> here? Should the local name variables increase their length or should >> the buffer length be reduced? > > You're right, the local name variables and snprintf argument don't match. > Thanks for noticing. > I think that we should increase the name variables to be > SNET_NAME_SIZE bytes long.If you can show that the string fits into the current length, it would be better to keep the stack usage low and just adapt the length to be sizeof(string) instead of SNET_NAME_SIZE. Arnd
Michael S. Tsirkin
2022-Dec-21 06:40 UTC
[PATCH 3/3 v6] virtio: vdpa: new SolidNET DPU driver.
On Tue, Dec 20, 2022 at 06:46:20PM +0200, Alvaro Karsz wrote:> Hi Nathan, > > > This does not appear to be a false positive but what was the intent > > here? Should the local name variables increase their length or should > > the buffer length be reduced? > > You're right, the local name variables and snprintf argument don't match. > Thanks for noticing. > I think that we should increase the name variables to be > SNET_NAME_SIZE bytes long. > > How should I proceed from here? > Should I create a new version for this patch, or should I fix it in a > follow up patch? > > Thanks, > AlvaroPlease post a follow-up ASAP. I can squash myself if I rebase. Thanks! -- MST