From 84b88781a0c39f7379ed85f74dc03c4e868a171f Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 17 Jan 2015 15:59:12 -0200 Subject: 10 Distinct fixes Addressing out of bounds read-write. Special Thanks to 4144, Haruna! Signed-off-by: shennetsind --- src/tool/mapcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tool') diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index 2ead5edbb..59d70b62d 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -129,7 +129,7 @@ void cache_map(char *name, struct map_data *m) encode_zip(write_buf, &len, m->cells, m->xs*m->ys); // Fill the map header - strncpy(info.name, name, MAP_NAME_LENGTH); + safestrncpy(info.name, name, MAP_NAME_LENGTH); if (strlen(name) > MAP_NAME_LENGTH) // It does not hurt to warn that there are maps with name longer than allowed. ShowWarning("Map name '%s' (length %"PRIuS") is too long. Truncating to '%s' (lentgh %d).\n", name, strlen(name), info.name, MAP_NAME_LENGTH); -- cgit v1.2.3-70-g09d2