From bda2a4984cd3c64ebbe858ea15ad9429af256527 Mon Sep 17 00:00:00 2001 From: Aaron Young Date: Wed, 3 Aug 2022 12:19:46 -0700 Subject: [PATCH] [nfs] Fix potential buffer overflow condition Fix potential buffer overflow condition in nfs_uri.c. Signed-off-by: Aaron Young --- src/net/oncrpc/nfs_uri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/oncrpc/nfs_uri.c b/src/net/oncrpc/nfs_uri.c index c4c3f21e9..1df3be69f 100644 --- a/src/net/oncrpc/nfs_uri.c +++ b/src/net/oncrpc/nfs_uri.c @@ -103,7 +103,7 @@ int nfs_uri_symlink ( struct nfs_uri *uri, const char *symlink ) { strcpy ( new_path + strlen ( new_path ), uri->lookup_pos ); } else { - len = strlen ( uri->lookup_pos ) + strlen ( symlink ); + len = strlen ( uri->lookup_pos ) + strlen ( symlink ) + 1; // +1 for NULL terminator if ( ! ( new_path = malloc ( len * sizeof ( char ) ) ) ) return -ENOMEM;