[nfs] Fix potential buffer overflow condition

Fix potential buffer overflow condition in nfs_uri.c.

Signed-off-by: Aaron Young <aaron.young@oracle.com>
pull/698/head
Aaron Young 2022-08-03 12:19:46 -07:00
parent d3c8944d5c
commit bda2a4984c
1 changed files with 1 additions and 1 deletions

View File

@ -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;