mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-08 21:16:39 +09:00
Bug #4745: Fix segfault for malformed template attributes
This commit is contained in:
1 parent
a69d305d73
commit
e95328a516
1 file changed
+6
-4
+6
-4
@@ -512,11 +512,11 @@ private:
|
||||
|
||||
multimap<string, Attribute *>::const_iterator i;
|
||||
|
||||
int j;
|
||||
int j = 0;
|
||||
|
||||
index = attributes.equal_range(name);
|
||||
|
||||
for (i = index.first, j = 0 ; i != index.second ; i++, j++)
|
||||
for (i = index.first; i != index.second ; i++)
|
||||
{
|
||||
const T * vatt = dynamic_cast<const T *>(i->second);
|
||||
|
||||
@@ -526,6 +526,7 @@ private:
|
||||
}
|
||||
|
||||
values.push_back(vatt);
|
||||
j++;
|
||||
}
|
||||
|
||||
return j;
|
||||
@@ -540,11 +541,11 @@ private:
|
||||
|
||||
multimap<string, Attribute *>::iterator i;
|
||||
|
||||
int j;
|
||||
int j = 0;
|
||||
|
||||
index = attributes.equal_range(name);
|
||||
|
||||
for (i = index.first, j = 0 ; i != index.second ; i++, j++)
|
||||
for (i = index.first; i != index.second ; i++)
|
||||
{
|
||||
T * vatt = dynamic_cast<T *>(i->second);
|
||||
|
||||
@@ -554,6 +555,7 @@ private:
|
||||
}
|
||||
|
||||
values.push_back(vatt);
|
||||
j++;
|
||||
}
|
||||
|
||||
return j;
|
||||
|
||||
Reference in new issue
Block a user