Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147001113
D36763.id111707.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
700 B
Referenced Files
None
Subscribers
None
D36763.id111707.diff
View Options
diff --git a/contrib/dma/mail.c b/contrib/dma/mail.c
--- a/contrib/dma/mail.c
+++ b/contrib/dma/mail.c
@@ -35,6 +35,7 @@
#include <errno.h>
#include <inttypes.h>
+#include <malloc_np.h>
#include <signal.h>
#include <strings.h>
#include <string.h>
@@ -418,8 +419,14 @@
* If we fix it, it better be the last line of
* the file.
*/
- line[linelen] = '\n';
- line[linelen + 1] = 0;
+ if ((size_t)linelen + 1 > linecap) {
+ line = realloc(line, linelen + 2);
+ if (line == NULL)
+ errlogx(EX_SOFTWARE, "realloc");
+ linecap = malloc_usable_size(line);
+ }
+ line[linelen++] = '\n';
+ line[linelen] = 0;
had_last_line = 1;
}
if (!had_first_line) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 11:53 AM (6 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29404877
Default Alt Text
D36763.id111707.diff (700 B)
Attached To
Mode
D36763: dma: restore addition of newline when missing from input
Attached
Detach File
Event Timeline
Log In to Comment