tests/logsv/tet_LogOiOps.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


 There is an uninitialized character in an static array of characters.
 When outputting the string, the character at that position is unknown.

 It causes trouble when passing the string to shell if the character is special 
ones.

 Fix them by initializing all elements.

diff --git a/tests/logsv/tet_LogOiOps.c b/tests/logsv/tet_LogOiOps.c
--- a/tests/logsv/tet_LogOiOps.c
+++ b/tests/logsv/tet_LogOiOps.c
@@ -3333,7 +3333,7 @@ void verFilenameLength_01(void)
        char fileName[220];
 
        /* Create a string with 218 characters */
-       memset(fileName, 'A', 218);
+       memset(fileName, 'A', sizeof(fileName));
        fileName[219] = '\0';
 
        /* Create an configurable obj class with invalid filename length */
@@ -3352,11 +3352,11 @@ void verFilenameLength_02(void)
        char fileName[220];
 
        /* Create a string with 218 characters */
-       memset(fileName, 'A', 218);
+       memset(fileName, 'A', sizeof(fileName));
        fileName[219] = '\0';
 
        /* Create an configurable obj class with invalid filename length */
-    sprintf(command, "immcfg -a saLogStreamFileName=. -a 
saLogStreamPathName=\"%s\" %s "
+    sprintf(command, "immcfg -a saLogStreamFileName=\"%s\" -a 
saLogStreamPathName=. %s "
                   "2> /dev/null", fileName, SA_LOG_STREAM_ALARM);
     rc = system(command);
        rc_validate(WEXITSTATUS(rc), 1);

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to