nsWindowsRegKey::readStringValue returns value plus trailing garbage

RESOLVED INVALID

Status

()

Core
XPCOM
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: darktrojan, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
If I run this code:

> var wrk = (Components
>            .classes["@mozilla.org/windows-registry-key;1"]
>            .createInstance(Components.interfaces.nsIWindowsRegKey));
> wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
>          "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
>          wrk.ACCESS_READ);
> var currentTZStandardName = wrk.readStringValue("TimeZoneKeyName");
> wrk.close()

currentTZStandardName is a 128-char string with the value, \0, and some trailing garbage. I suspect it might be something to do with bug 936886.
(Reporter)

Comment 1

4 years ago
This is a bug in Windows, apparently: https://stackoverflow.com/a/27736310

Thanks to :Kwan for figuring this out.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.