Harden plaintext authenticator
[exim.git] / src / src / auths / plaintext.c
index 7a0f788529456834efb4d6d821fceb76253cc927..fa05b0ad5725d9f947b9d07f8443aa087b7c2841 100644 (file)
@@ -223,11 +223,7 @@ while ((s = string_nextinlist(&text, &sep, big_buffer, big_buffer_size)))
       if (ss[i+1] != '^')
        ss[i] = 0;
       else
-        {
-        i++;
-        len--;
-        memmove(ss + i, ss + i + 1, len - i);
-        }
+        if (--len > ++i) memmove(ss + i, ss + i + 1, len - i);
 
   /* The first string is attached to the AUTH command; others are sent
   unembellished. */