From 4096345176e3433352895d96fbe77c5921a56616 Mon Sep 17 00:00:00 2001 From: David Hall Date: Tue, 17 Dec 2019 20:04:02 -0700 Subject: [PATCH] Fixed incorrect buffer length in GetUNCServer (#78) --- System/Path.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/Path.cs b/System/Path.cs index b3ca3964..6e2eecee 100644 --- a/System/Path.cs +++ b/System/Path.cs @@ -182,7 +182,7 @@ namespace Vanara.IO /// /// The UNC path. /// On success, the server portion of the UNC path. On failure, is returned. - public static string GetUNCServer(string path) => PathIsUNCEx(path, out var ptr) ? StringHelper.GetString(ptr, System.Runtime.InteropServices.CharSet.Unicode, path.Length) : null; + public static string GetUNCServer(string path) => PathIsUNCEx(path, out var ptr) ? StringHelper.GetString(ptr, System.Runtime.InteropServices.CharSet.Unicode, (path.Length + 1) * 2) : null; /// /// Searches a path to determine if it contains a valid prefix of the type passed by . A prefix is one of