From 84eb59c3ce5fbdb2a34e717079ed46f38ea516e7 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 12 Apr 2017 12:45:17 +0200 Subject: [PATCH] Prevent buffer overrun When compiled with older Microsoft libraries, the unsafe implemention of snprintf results in non-null terminated strings, causing numerous subsequent issues. This fix just enlarges the used buffer to accommdate longer strings. A more complete solution would include the use more recent Microsoft libraries in the build process. The larger buffer is still need then, to prevent trucated (but proper null terminated) strings. ref: https://github.com/Subsurface-divelog/subsurface/issues/301 Signed-off-by: Jan Mulder --- src/shearwater_predator_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c index 6c66cec..eaca0ec 100644 --- a/src/shearwater_predator_parser.c +++ b/src/shearwater_predator_parser.c @@ -214,7 +214,7 @@ shearwater_predator_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *d } -#define BUFLEN 16 +#define BUFLEN 32 static dc_status_t shearwater_predator_parser_cache (shearwater_predator_parser_t *parser)