From e43d6645e4cc79aacce6cad559dc1a0df68ef651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 1 Jun 2017 01:36:38 +0100 Subject: [PATCH] Replace VLA with new[]. --- src/plugins/libparted/libpartedpartitiontable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/libparted/libpartedpartitiontable.cpp b/src/plugins/libparted/libpartedpartitiontable.cpp index fc44dc0..d98ab34 100644 --- a/src/plugins/libparted/libpartedpartitiontable.cpp +++ b/src/plugins/libparted/libpartedpartitiontable.cpp @@ -249,10 +249,11 @@ bool LibPartedPartitionTable::clobberFileSystem(Report& report, const Partition& // We need to use memset instead of = {0} because clang sucks. const long long zeroes_length = pedDevice()->sector_size*129; - char zeroes[zeroes_length]; + char* zeroes = new char[zeroes_length]; memset(zeroes, 0, zeroes_length*sizeof(char)); rval = ped_geometry_write(&pedPartition->geom, zeroes, 0, 129); + delete[] zeroes; if (!rval) report.line() << xi18nc("@info:progress", "Failed to erase filesystem signature on partition %1.", partition.deviceNode());