mlmmj

changeset 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 diff
     1.1 --- a/ChangeLog	Wed Oct 06 10:12:23 2010 +1100
     1.2 +++ b/ChangeLog	Wed Oct 06 23:26:26 2010 +1100
     1.3 @@ -1,3 +1,4 @@
     1.4 + o Fix theoretically possible memory corruption by chomp()
     1.5   o Remove .sh from mlmmj-make-ml.sh; symlink original name
     1.6   o Correct spelling of 'receive' and 'voodoo' throughout the code and
     1.7     documentation, making mlmmj-recieve a symlink to mlmmj-receive (Chris Webb)
     2.1 --- a/src/chomp.c	Wed Oct 06 10:12:23 2010 +1100
     2.2 +++ b/src/chomp.c	Wed Oct 06 23:26:26 2010 +1100
     2.3 @@ -31,7 +31,7 @@
     2.4  	if(str == NULL)
     2.5  		return NULL;
     2.6  
     2.7 -	if(*str == '\0' || *str == '\n') {
     2.8 +	if(*str == '\0' || *str == '\n' || *str == '\r') {
     2.9  		*str = '\0';
    2.10  		return str;
    2.11  	}