diff options
author | Werner Koch <[email protected]> | 2023-03-21 09:33:34 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-03-21 09:34:52 +0000 |
commit | 68333be63042be281a497a5751474e9e3d119dc3 (patch) | |
tree | 124736ef0d6cbb03a49718324065e9cdc062821d /src/sysutils.c | |
parent | build: Improve the beta numbering by autogen.sh (diff) | |
download | libgpg-error-68333be63042be281a497a5751474e9e3d119dc3.tar.gz libgpg-error-68333be63042be281a497a5751474e9e3d119dc3.zip |
Avoid segv in logging with improper use of the "socket://" .
* src/logging.c (fun_writer): Protect calling socket_dir_cb if not
set.
--
If no callback has been registered the use of the "socket://" shortcut
caused a segv.
Diffstat (limited to 'src/sysutils.c')
-rw-r--r-- | src/sysutils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sysutils.c b/src/sysutils.c index 1251ed6..fac72bf 100644 --- a/src/sysutils.c +++ b/src/sysutils.c @@ -141,6 +141,10 @@ _gpgrt_setenv (const char *name, const char *value, int overwrite) if (!value && overwrite) { + /* Deleting an envvar. Although the Microsoft specs for + * putenv tell us that one may use "NAME=" to unset an envvar, + * this seems not to be correct. Thus we do the same as what + * we do in Unix (or well in GNU libc) and use just "NAME". */ if (!SetEnvironmentVariable (name, NULL)) return GPG_ERR_EINVAL; if (getenv (name)) |