]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Fix off by one error
authormmj <none@none>
Tue, 18 Jan 2005 10:47:42 +0000 (21:47 +1100)
committermmj <none@none>
Tue, 18 Jan 2005 10:47:42 +0000 (21:47 +1100)
src/mail-functions.c

index 23009e56455c01f26851f1250789a29bf2dae44f..8a0e49fd59509dbff762a273d86fc2f9e1494a7f 100644 (file)
@@ -212,7 +212,7 @@ char *get_prepped_mailbody_from_map(char *mapstart, size_t size, size_t *blen)
        for(next = cur = endhdrs; next < mapstart + size; next++) {
                if(*next == '\n') {
                        n++;
-                       if(*(next+1) == '.')
+                       if((next < mapstart + size - 1) && *(next+1) == '.')
                                n++;
                }
        }
@@ -228,7 +228,7 @@ char *get_prepped_mailbody_from_map(char *mapstart, size_t size, size_t *blen)
                        newlinebuf[0] = '\r';
                        newlinebuf[1] = '\n';
                        len = 2;
-                       if(*(next+1) == '.') {
+                       if((next < mapstart + size - 1) && *(next+1) == '.') {
                                newlinebuf[2] = '.';
                                len = 3;
                        }