Browse Source

engine: common: lib_common: fix offset by one UB

pull/2/head
Alibek Omarov 2 years ago
parent
commit
fb0f184d6b
  1. 4
      engine/common/lib_common.c

4
engine/common/lib_common.c

@ -410,11 +410,13 @@ char **COM_ConvertToLocalPlatform( EFunctionMangleType to, const char *from, siz
if( at ) len = (uint)( at - prev ); if( at ) len = (uint)( at - prev );
else len = (uint)Q_strlen( prev ); else len = (uint)Q_strlen( prev );
Q_strncpy( symbols[i], prev, Q_min( len + 1, sizeof( symbols[i] ))); Q_strncpy( symbols[i], prev, Q_min( len + 1, sizeof( symbols[i] )));
prev = at + 1;
if( !at ) if( !at )
break; break;
prev = at + 1;
} }
if( i == MAX_NESTED_NAMESPACES ) if( i == MAX_NESTED_NAMESPACES )

Loading…
Cancel
Save