From b9fa2e75158c9df722e85d50909429ba2e4faf29 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 16 Jun 2004 19:10:11 +0000 Subject: [PATCH] More string termination bugs, this time missing terminators. --- src/libCom/macLib/macCore.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libCom/macLib/macCore.c b/src/libCom/macLib/macCore.c index 143fa57fc..6c6eca209 100644 --- a/src/libCom/macLib/macCore.c +++ b/src/libCom/macLib/macCore.c @@ -756,6 +756,9 @@ static void trans( MAC_HANDLE *handle, MAC_ENTRY *entry, long level, if ( v < valend ) *v++ = '('; cpy2val( name2, &v, valend ); if ( v < valend ) *v++ = ')'; + + /* ensure string remains properly terminated */ + if ( v <= valend ) *v = '\0'; } continue; } @@ -770,6 +773,9 @@ static void trans( MAC_HANDLE *handle, MAC_ENTRY *entry, long level, if ( v < valend ) *v++ = '('; cpy2val( name2, &v, valend ); if ( v < valend ) *v++ = ')'; + + /* ensure string remains properly terminated */ + if ( v <= valend ) *v = '\0'; continue; }