Fix $regex<n> use-after-free. Bug 2915
[exim.git] / src / src / dcc.c
index fe2e1340fc8c470003a0ba7161857dbd94b928c0..a9124a013a7b177addab97352cfd3f132a66fdb9 100644 (file)
@@ -7,7 +7,7 @@
  * wbreyha@gmx.net
  * See the file NOTICE for conditions of use and distribution.
  *
- * Copyright (c) The Exim Maintainers 2015 - 2019
+ * Copyright (c) The Exim Maintainers 2015 - 2021
  */
 
 /* Code for calling dccifd. Called from acl.c. */
@@ -333,7 +333,7 @@ while((dcc_resplen = read(sockfd, big_buffer, big_buffer_size-1)) > 0)
                 "DCC: -----------------------------------\n", dcc_resplen, dcc_resplen, big_buffer);
 
   /* Now let's read each character and see what we've got */
-  for(bufoffset = 0; bufoffset < dcc_resplen, line <= 2; bufoffset++)
+  for(bufoffset = 0; bufoffset < dcc_resplen && line <= 2; bufoffset++)
     {
     /* First check if we reached the end of the line and
     then increment the line counter */