diff options
author | Stephen D. Huston <shuston@apache.org> | 2015-02-24 01:51:14 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2015-02-24 01:51:14 +0000 |
commit | 6230bdd9ee37b932456ea6e2bf42ecd028424e70 (patch) | |
tree | 3e2a0d88179f76403419dc109f92fd63dfe8751b | |
parent | 1d1a59a9e9dfc807ac2613f5b67f49e2dfa09fc0 (diff) | |
download | qpid-python-6230bdd9ee37b932456ea6e2bf42ecd028424e70.tar.gz |
Don't take the address of a 0-length vector. Fixes QPID-6409.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1661830 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/tests/BrokerFixture.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/BrokerFixture.h b/qpid/cpp/src/tests/BrokerFixture.h index c455dd10fc..474b9d747f 100644 --- a/qpid/cpp/src/tests/BrokerFixture.h +++ b/qpid/cpp/src/tests/BrokerFixture.h @@ -101,11 +101,13 @@ struct BrokerFixture : private boost::noncopyable { opts.auth=false; // Argument parsing - std::vector<const char*> argv(args.size()); - for (size_t i = 0; i<args.size(); ++i) - argv[i] = args[i].c_str(); - Plugin::addOptions(opts); - opts.parse(argv.size(), &argv[0]); + if (args.size() > 0) { + std::vector<const char*> argv(args.size()); + for (size_t i = 0; i<args.size(); ++i) + argv[i] = args[i].c_str(); + Plugin::addOptions(opts); + opts.parse(argv.size(), &argv[0]); + } broker = Broker::create(opts); // TODO aconway 2007-12-05: At one point BrokerFixture // tests could hang in Connection ctor if the following |