Bug 9962 - SecureString.RemoveAt(int) function mangles string
Summary: SecureString.RemoveAt(int) function mangles string
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2013-01-31 19:18 UTC by David Lechner
Modified: 2016-02-15 16:57 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
C# program that demonstrates problem (838 bytes, text/plain)
2013-01-31 19:18 UTC, David Lechner
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description David Lechner 2013-01-31 19:18:58 UTC
Created attachment 3319 [details]
C# program that demonstrates problem

Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1)

I am developing a secure password entry box that uses SecureString.I have found that the SecureString.RemoveAt(int) function is not working correctly. This problem was also noted by someone else at http://answers.unity3d.com/questions/45492/securestring-problem.html

It looks like RemoveAt is remove bytes with a bad offset or something like that.

I have attached a test program to demonstrate the problem.

expected output is:
t
te
tes
test
est
st
t

actual output is:
t
te
tes
test
琀攀猀
es
攀
Comment 1 David Lechner 2013-01-31 22:26:53 UTC
Submitted pull request: https://github.com/mono/mono/pull/541
Comment 2 marcos.henrich 2016-02-15 16:57:00 UTC
The pull request above fixed the issue.