aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog5
-rw-r--r--common/session-env.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index c0f618e85..9c18680ce 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-10 Werner Koch <[email protected]>
+
+ * session-env.c (update_var): Fix same value test. Fixes
+ bug#1311.
+
2010-09-16 Werner Koch <[email protected]>
* util.h: Add GPG_ERR_MISSING_ISSUER_CERT.
diff --git a/common/session-env.c b/common/session-env.c
index ef36dbcbf..10f5dfe35 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;
}