From 6d6e063a0fd132c49490f01949dfa5fa28125a33 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 23 Feb 2016 20:17:41 +0100 Subject: [PATCH] libdm: fix string boundary The test for string 'end' needs to account for ending \0, which also needs to fit = fcanonical_len) { - log_error("%s: field name too long", field); + if ((i + 1) >= fcanonical_len) { + canonical_field[0] = '\0'; + log_error("%s: field name too long.", field); return 0; } canonical_field[i++] = *field;