Skip to content

Commit

Permalink
An attempt was made to prevent occurrence of the access violation exc…
Browse files Browse the repository at this point in the history
…eption in the `PtrToString` method
  • Loading branch information
Taritsyn committed Oct 25, 2019
1 parent df7df2f commit cd0f6ea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/LibSassHost/Helpers/MarshallingHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public static unsafe string PtrToString(IntPtr ptr)
result = Encoding.UTF8.GetString(pBuffer, bufferLength);
#else
var byteArrayPool = ArrayPool<byte>.Shared;
byte[] buffer = byteArrayPool.Rent(bufferLength + 1);
buffer[bufferLength] = 0;
byte[] buffer = byteArrayPool.Rent(bufferLength);

try
{
Expand Down
3 changes: 1 addition & 2 deletions src/LibSassHost/LibSassHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ This package does not contain the native implementations of LibSass. Therefore,
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageTags>LibSass;Sass;SCSS;CSS</PackageTags>
<PackageReleaseNotes>1. Added support of the LibSass version 3.6.2;
2. Enabled a SourceLink in NuGet package.</PackageReleaseNotes>
<PackageReleaseNotes>An attempt was made to prevent occurrence of the access violation exception in the `PtrToString` method.</PackageReleaseNotes>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
Expand Down
4 changes: 2 additions & 2 deletions src/LibSassHost/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
=============
RELEASE NOTES
=============
1. Added support of the LibSass version 3.6.2;
2. Enabled a SourceLink in NuGet package.
An attempt was made to prevent occurrence of the access violation exception in
the `PtrToString` method.

============
PROJECT SITE
Expand Down
4 changes: 0 additions & 4 deletions test/LibSassHost.Test.Common/LibSassHost.Test.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<ProjectReference Include="..\..\src\LibSassHost\LibSassHost.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net471' ">
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.0' ">
<PackageReference Include="LibSassHost.Native.linux-x64" Version="1.2.7" />
<PackageReference Include="LibSassHost.Native.osx-x64" Version="1.2.7" />
Expand Down

0 comments on commit cd0f6ea

Please sign in to comment.