diff options
| -rw-r--r-- | src/map/amap/amapLiberty.c | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index e3391e66..bd554f8d 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -179,6 +179,7 @@ char * Amap_LibertyTimeStamp()      time( <ime );      TimeStamp = asctime( localtime( <ime ) );      TimeStamp[ strlen(TimeStamp) - 1 ] = 0; +    assert( strlen(TimeStamp) < 100 );      strcpy( Buffer, TimeStamp );      return Buffer;  } @@ -310,6 +311,7 @@ int Amap_LibertyCellCountOutputs( Amap_Tree_t * p, Amap_Item_t * pCell )  char * Amap_LibertyGetString( Amap_Tree_t * p, Amap_Pair_t Pair )     {       static char Buffer[256];  +    assert( Pair.End-Pair.Beg < 256 );      strncpy( Buffer, p->pContents+Pair.Beg, Pair.End-Pair.Beg );       Buffer[Pair.End-Pair.Beg] = 0;      return Buffer; @@ -329,6 +331,7 @@ char * Amap_LibertyGetString( Amap_Tree_t * p, Amap_Pair_t Pair )  char * Amap_LibertyGetStringFormula( Amap_Tree_t * p, Amap_Pair_t Pair )     {       static char Buffer[256];  +    assert( Pair.End-Pair.Beg-2 < 256 );      strncpy( Buffer, p->pContents+Pair.Beg+1, Pair.End-Pair.Beg-2 );       Buffer[Pair.End-Pair.Beg-2] = 0;      return Buffer; | 
