From 5f10d9d8c1553983bc1e17874b52b39f1687360d Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Wed, 7 Aug 2019 07:40:57 -0700 Subject: [PATCH] There is no need to zero static data, and it is racy (mono/mono#15699) if there are multiple threads calling (unlikely). This zeroing was made moot by mono/mono@470354fa817716739615ff0c6cfefca42ec8b385 January 2019. Commit migrated from https://github.com/mono/mono/commit/e8d28feb1e7a8cb0820704aee66410f4ae13c252 --- src/mono/mono/utils/mono-merp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/utils/mono-merp.c b/src/mono/mono/utils/mono-merp.c index d3e977e..c8ba887 100644 --- a/src/mono/mono/utils/mono-merp.c +++ b/src/mono/mono/utils/mono-merp.c @@ -49,7 +49,9 @@ os_version_string (void) static const char *version_string; if (!version_string) { - memset (&name, 0, sizeof (name)); // WSL does not always nul terminate. + // WSL does not always nul terminate. WSL was fixed February 2018. + // Restore memset if variable made non-static. + //memset (&name, 0, sizeof (name)); if (uname (&name) >= 0) version_string = name.release; -- 2.7.4