[PATCH 2/3] Removed liquivision unneeded variable and potential segfault.

John Van Ostrand john at vanostrand.com
Sun Nov 9 10:03:06 PST 2014


Signed-off-by: John Van Ostrand <john at vanostrand.com>
---
 liquivision.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/liquivision.c b/liquivision.c
index 4234864..5ec241c 100644
--- a/liquivision.c
+++ b/liquivision.c
@@ -337,7 +337,6 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int
 
 int try_to_open_liquivision(const char *filename, struct memblock *mem)
 {
-	void *name;
 	const unsigned char *buf = mem->buffer;
 	unsigned int buf_size = mem->size;
 	unsigned int ptr;
@@ -345,10 +344,7 @@ int try_to_open_liquivision(const char *filename, struct memblock *mem)
 
 	// Get name
 	unsigned int len = array_uint32_le(buf);
-	if (len) {
-		name = malloc(len);
-		strncpy(name, buf + 4, len);
-	}
+	// Ignore name
 	ptr = 4 + len;
 
 	unsigned int dive_count = array_uint32_le(buf + ptr);
-- 
1.8.3.1



More information about the subsurface mailing list