summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/cmndline.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-06-09 13:15:34 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-06-09 13:15:34 +0200
commit189bb640d2443a5fcaade2ce169429c629ba3148 (patch)
tree1046a11805ae78557e9947569f91c2f8fa853f88 /apt-pkg/contrib/cmndline.cc
parentba74b79fb5c74d916f9bfe1b314e8107a9e7eab4 (diff)
parent308b793694774eece8765d172b8e989d8ed29925 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/contrib/cmndline.cc')
-rw-r--r--apt-pkg/contrib/cmndline.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 0b16bf51a..5a9944096 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -360,11 +360,11 @@ bool CommandLine::DispatchArg(Dispatch *Map,bool NoMatch)
than nothing after all. */
void CommandLine::SaveInConfig(unsigned int const &argc, char const * const * const argv)
{
- char cmdline[300];
+ char cmdline[100 + argc * 50];
unsigned int length = 0;
bool lastWasOption = false;
bool closeQuote = false;
- for (unsigned int i = 0; i < argc; ++i, ++length)
+ for (unsigned int i = 0; i < argc && length < sizeof(cmdline); ++i, ++length)
{
for (unsigned int j = 0; argv[i][j] != '\0' && length < sizeof(cmdline)-1; ++j, ++length)
{