aboutsummaryrefslogtreecommitdiffstats
path: root/common/session-env.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-01-10 10:37:57 +0000
committerAndrey Jivsov <[email protected]>2011-01-10 22:19:28 +0000
commitb0c55d08a8c835fd58d3c0d1f9f412b74c1b5678 (patch)
treedc454ed3c0c59eca67735dd603145ebc3bb9e634 /common/session-env.c
parentMilestone: Data signing/verification and key signing/verification work with E... (diff)
downloadgnupg-b0c55d08a8c835fd58d3c0d1f9f412b74c1b5678.tar.gz
gnupg-b0c55d08a8c835fd58d3c0d1f9f412b74c1b5678.zip
Fix bug #1311.
Diffstat (limited to '')
-rw-r--r--common/session-env.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/session-env.c b/common/session-env.c
index 2dcf425b6..d719a7b87 100644
--- a/common/session-env.c
+++ b/common/session-env.c
@@ -183,10 +183,11 @@ update_var (session_env_t se, const char *string, size_t namelen,
else if (!strncmp (se->array[idx]->name, string, namelen)
&& strlen (se->array[idx]->name) == namelen)
{
- /* Check if the value is the same; no need to update it,
- except for updating the default flag. */
if (strlen (se->array[idx]->value) == valuelen)
{
+ /* The new value has the same length. We can update it
+ in-place. */
+ memcpy (se->array[idx]->value, value, valuelen);
se->array[idx]->is_default = !!set_default;
return 0;
}