Anonymous | Login | Signup for a new account | 2024-04-27 03:00 CEST |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000104 | openvibe | bug report | public | 2012-04-26 13:02 | 2012-05-03 15:15 | ||||
Reporter | antona | ||||||||
Assigned To | jlegeny | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | Windows | OS | XP | OS Version | XP | ||||
Summary | 0000104: Deletion of unallocated memory | ||||||||
Description | Project: OpenViBE-plugins-file-io-dynamic File: ovpCGDFFileWriter.cpp Function: void CGDFFileWriter::setValue(const uint32 ui32ValueIdentifier, const char* sValue) If "sValue" is empty then strlen returns "0" and then the allocated memory for "l_pFormattedSubjectName" is 0, but then we delete it. | ||||||||
Steps To Reproduce | This problem was detected by Microsoft VC++ compiler in debug mode. | ||||||||
Additional Information | This code fixes the problem: case IBoxAlgorithmExperimentInformationInputReaderCallback::Value_SubjectName: { if (strlen(sValue)>0) { char * l_pFormattedSubjectName = new char[strlen(sValue)]; strcpy(l_pFormattedSubjectName, sValue); char * l_pSpaceInSubjectName; //replaces all spaces by underscores while( (l_pSpaceInSubjectName = strchr(l_pFormattedSubjectName , ' ')) != NULL) { *l_pSpaceInSubjectName = '_'; } sprintf(m_oFixedHeader.m_sPatientId + 31, "%s", "Anton");//changed by Anton to test problem delete[] l_pFormattedSubjectName; } } | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Notes | |
(0001014) antona (reporter) 2012-04-26 13:09 |
sprintf(m_oFixedHeader.m_sPatientId + 31, "%s", "Anton"); should be: sprintf(m_oFixedHeader.m_sPatientId + 31, "%s", l_pFormattedSubjectName); |
(0001016) jlegeny (reporter) 2012-05-03 15:15 |
Thank you for the patch, it has been commited in r3235 |
Issue History | |||
Date Modified | Username | Field | Change |
2012-04-26 13:02 | antona | New Issue | |
2012-04-26 13:09 | antona | Note Added: 0001014 | |
2012-05-03 15:15 | jlegeny | Note Added: 0001016 | |
2012-05-03 15:15 | jlegeny | Status | new => resolved |
2012-05-03 15:15 | jlegeny | Resolution | open => fixed |
2012-05-03 15:15 | jlegeny | Assigned To | => jlegeny |
Copyright © 2000 - 2024 MantisBT Team |