From 88ebf0e258ac8eb3b5dc2cd6cfc36d5336ff9612 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 24 Apr 2004 15:09:32 +0000 Subject: [PATCH] Zero-terminate strings read from the RM file. --- librmff/rmff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/librmff/rmff.c b/librmff/rmff.c index c152bee20..ce1fecae5 100644 --- a/librmff/rmff.c +++ b/librmff/rmff.c @@ -677,11 +677,13 @@ rmff_read_headers(rmff_file_t *file) { if (size > 0) { mdpr->name = (char *)safemalloc(size + 1); io->read(fh, mdpr->name, size); + mdpr->name[size] = 0; } size = read_uint8(); /* mime_type_len */ if (size > 0) { mdpr->mime_type = (char *)safemalloc(size + 1); io->read(fh, mdpr->mime_type, size); + mdpr->mime_type[size] = 0; } size = read_uint32_be(); /* type_specific_size */ rmff_put_uint32_be(&mdpr->type_specific_size, size);