changeset 753:b58fd7980358

Fix theoretically possible memory corruption by chomp() A quick survey of callers of chomp() suggests this never could occur in practice
author Ben Schmidt
date Wed, 06 Oct 2010 23:26:26 +1100
parents c02582939bbc
children ecb991e41a4c
files ChangeLog src/chomp.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 06 10:12:23 2010 +1100
+++ b/ChangeLog	Wed Oct 06 23:26:26 2010 +1100
@@ -1,3 +1,4 @@
+ o Fix theoretically possible memory corruption by chomp()
  o Remove .sh from mlmmj-make-ml.sh; symlink original name
  o Correct spelling of 'receive' and 'voodoo' throughout the code and
    documentation, making mlmmj-recieve a symlink to mlmmj-receive (Chris Webb)
--- a/src/chomp.c	Wed Oct 06 10:12:23 2010 +1100
+++ b/src/chomp.c	Wed Oct 06 23:26:26 2010 +1100
@@ -31,7 +31,7 @@
 	if(str == NULL)
 		return NULL;
 
-	if(*str == '\0' || *str == '\n') {
+	if(*str == '\0' || *str == '\n' || *str == '\r') {
 		*str = '\0';
 		return str;
 	}