mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Bug #4745: Fix segfault for malformed template attributes
This commit is contained in:
parent
a69d305d73
commit
e95328a516
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user