qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shus...@apache.org
Subject svn commit: r1661830 - /qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h
Date Tue, 24 Feb 2015 01:51:14 GMT
Author: shuston
Date: Tue Feb 24 01:51:14 2015
New Revision: 1661830

URL: http://svn.apache.org/r1661830
Log:
Don't take the address of a 0-length vector. Fixes QPID-6409.

Modified:
    qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h

Modified: qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h?rev=1661830&r1=1661829&r2=1661830&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h (original)
+++ qpid/trunk/qpid/cpp/src/tests/BrokerFixture.h Tue Feb 24 01:51:14 2015
@@ -101,11 +101,13 @@ struct  BrokerFixture : private boost::n
         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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message