Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1583-win32-Fix-crash-on-zero-sized-REG_SZ-value...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1583-win32-Fix-crash-on-zero-sized-REG_SZ-values.patch of Package erlang
From 424eef8a11c68fe36120e4e8e3be23317a39c974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org> Date: Mon, 7 Oct 2024 12:27:33 +0200 Subject: [PATCH] win32: Fix crash on zero-sized REG_SZ values --- erts/emulator/drivers/win32/registry_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erts/emulator/drivers/win32/registry_drv.c b/erts/emulator/drivers/win32/registry_drv.c index 2759d6301e..3779c6cfac 100644 --- a/erts/emulator/drivers/win32/registry_drv.c +++ b/erts/emulator/drivers/win32/registry_drv.c @@ -374,8 +374,11 @@ fix_value_result(RegPort* rp, LONG result, DWORD type, switch (type) { case REG_SZ: case REG_EXPAND_SZ: - valueSize--; /* No reason to send the '\0' to Erlang. */ - break; + /* No reason to send the trailing '\0', if present, to Erlang. */ + if (valueSize > 0 && value[valueSize - 1] == '\0') { + valueSize--; + } + break; case REG_DWORD_LITTLE_ENDIAN: case REG_DWORD_BIG_ENDIAN: /* -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor