char aBuf[THE_BUF_SIZE];
Standard_Integer aNameBufferSize;
theStream.read ((char *)&aNameBufferSize, sizeof(Standard_Integer));
- if (theStream.eof() || aNameBufferSize > THE_BUF_SIZE)
+ if (theStream.eof() || aNameBufferSize > THE_BUF_SIZE - 1)
return Standard_False;
#ifdef DO_INVERSE
aNameBufferSize = InverseSize(aNameBufferSize);
#endif
if (aNameBufferSize > 0) {
theStream.read ((char *)&aBuf[0], (Standard_Size)aNameBufferSize);
- aBuf[aNameBufferSize] = '\0';
+ aBuf[aNameBufferSize-1] = '\0';
theSection.myName = (Standard_CString)&aBuf[0];
uint64_t aValue[3];
void yy_delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b ) {
+ YY_FATAL_ERROR("out of dynamic memory in yy_delete_buffer()");
+ return;
+ }
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
+ if ( ! b ) {
+ YY_FATAL_ERROR("out of dynamic memory in yy_init_buffer()");
+ return;
+ }
+
int oerrno = errno;
yy_flush_buffer( b );
*/
void yy_flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b ) {
+ YY_FATAL_ERROR("out of dynamic memory in yy_flush_buffer()");
+ return;
+ }
b->yy_n_chars = 0;
continue;
}
if (nc == 0) thewordeb.SetValue (thenbwords,i);
- if (nc > MAXCARS) { std::cout<<"Arg."<<thenbwords<<" > "<<MAXCARS<<" car.s, tronque"<<std::endl; continue; }
+ if (nc >= MAXCARS - 1) { std::cout<<"Arg."<<thenbwords<<" > "<<MAXCARS<<" car.s, tronque"<<std::endl; continue; }
unarg[nc] = val; nc ++;
}
if (nc > 0) {
- unarg[nc] = '\0'; thewords(thenbwords).Clear();
+ unarg[nc + 1] = '\0'; thewords(thenbwords).Clear();
thewords(thenbwords).AssignCat(unarg);
#ifdef DEBUG_TRACE
std::cout<<"thewords("<<thenbwords<<")="<<unarg<<std::endl<<" .. Fin avec thenbwords="<<thenbwords+1<<std::endl;
======================================================================*/
int perf_start_imeter (const int iMeter)
{
- if (iMeter >= 0 && iMeter < nb_meters) {
+ if (iMeter >= 0 && iMeter < nb_meters && iMeter < MAX_METERS) {
PICK_TIME (MeterTable[iMeter].start_time)
return iMeter;
}
void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file )
{
+ if ( ! b )
+ return;
+
int oerrno = errno;
yy_flush_buffer( b );