From: Zdenek Kabelac Date: Tue, 23 Feb 2016 20:41:15 +0000 (UTC) Subject: master - libdm: fix string boundary Message-ID: <20160223204115.8F736607C7@fedorahosted.org> List-Id: To: lvm-devel@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6d6e063a0fd132c49490f01949dfa5fa28125a33 Commit: 6d6e063a0fd132c49490f01949dfa5fa28125a33 Parent: eccc91f9b0ef7387f46cdd93e3f44ab45e0c1ba3 Author: Zdenek Kabelac AuthorDate: Tue Feb 23 20:17:41 2016 +0100 Committer: Zdenek Kabelac CommitterDate: Tue Feb 23 21:38:52 2016 +0100 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;