Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3fdc4790 authored by Johnny Jazeix's avatar Johnny Jazeix Committed by Mathieu Faverge
Browse files

fix crash when more than 32 elements

parent 3a97d7bb
No related branches found
No related tags found
1 merge request!9Resolve "Crashes on extended Event type definition"
......@@ -78,10 +78,10 @@ typedef enum paje_eventdef_e {
/*!
* \brief Names of the fields describing events
* This is a non echaustive list of the names which can be used
* to described the fields of each events. This list conatins
* This is a non exhaustive list of the names which can be used
* to described the fields of each events. This list contains
* only the field's name required by some events. It can be
* automatically extended inside the trace to be adfapted to
* automatically extended inside the trace to be adapted to
* the need of the user.
*/
#define FIELDNAME_SIZEMAX 32
......
......@@ -319,7 +319,10 @@ void ParserDefinitionPaje::add_field_to_definition(const PajeLine_t *line){
#else
strcpy_s(newfn, size, fieldname);
#endif
// In case there are more than the default value
if(_FieldNames.size() <= _nbFieldNames) {
_FieldNames.resize(2*_nbFieldNames);
}
_FieldNames[_nbFieldNames]._name = newfn;
_FieldNames[_nbFieldNames]._id = _nbFieldNames;
_FieldNames[_nbFieldNames]._code = (1 << _nbFieldNames);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment