diff mbox

hdata/fsp: fixup lpc device node name creation

Message ID 1486018810-31799-1-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Feb. 2, 2017, 7 a.m. UTC
snprintf() with size of a pointer rather than the buffer to which we
were printing into

Found by static analysis.

Fixes: 690f9da985b5f40d4f87ff161d43fd6989f6495c
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hdata/fsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stewart Smith Feb. 3, 2017, 3:10 a.m. UTC | #1
Stewart Smith <stewart@linux.vnet.ibm.com> writes:
> snprintf() with size of a pointer rather than the buffer to which we
> were printing into
>
> Found by static analysis.
>
> Fixes: 690f9da985b5f40d4f87ff161d43fd6989f6495c
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

merged to master as of 86024775a57951261d01d4fa92f8b346733bb982
diff mbox

Patch

diff --git a/hdata/fsp.c b/hdata/fsp.c
index f81c8dd4ede3..656aad70927e 100644
--- a/hdata/fsp.c
+++ b/hdata/fsp.c
@@ -235,7 +235,7 @@  static struct dt_node *add_lpc_io_node(struct dt_node *parent,
 	 * serial@i3f8 - refers to offset 0x3f8 in the IO space
 	 */
 
-	snprintf(buffer, sizeof(name), "%s@i%x", name, offset);
+	snprintf(buffer, sizeof(buffer), "%s@i%x", name, offset);
 	n = dt_new(parent, buffer);
 	assert(n);