diff --git a/README.maintainer b/README.maintainer index 0a270e2a..209a5ebf 100644 --- a/README.maintainer +++ b/README.maintainer @@ -17,6 +17,13 @@ Release Reminders running a spelling checker over the source code to catch errors in variable names, strings, and comments. Use ispell -p ispell-words. + * Run tests with sanitize address enabled: + + ./configure CFLAGS="-fsanitize=address -g" \ + CXXFLAGS="-fsanitize=address -g" \ + LDFLAGS="-fsanitize=address" \ + --enable-werror --disable-shared + * Consider running tests with latest gcc and/or valgrind. To do this, replace, build with debugging and without shared libraries. In build, create z and move each executable into z. Then create a diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index a5724fed..86753945 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -2050,7 +2050,7 @@ int main(int argc, char* argv[]) // deleted by using PointerHolder objects to back the pointers in // argv. std::vector > new_argv; - new_argv.push_back(PointerHolder(QUtil::copy_string(argv[0]), true)); + new_argv.push_back(PointerHolder(true, QUtil::copy_string(argv[0]))); for (int i = 1; i < argc; ++i) { if ((strlen(argv[i]) > 1) && (argv[i][0] == '@')) @@ -2060,10 +2060,10 @@ int main(int argc, char* argv[]) else { new_argv.push_back( - PointerHolder(QUtil::copy_string(argv[i]), true)); + PointerHolder(true, QUtil::copy_string(argv[i]))); } } - PointerHolder argv_ph(new char*[1+new_argv.size()], true); + PointerHolder argv_ph(true, new char*[1+new_argv.size()]); argv = argv_ph.getPointer(); for (size_t i = 0; i < new_argv.size(); ++i) {