[PATCH 09/10] psximfs02/init.c: Avoid potential string overflow

Joel Sherrill joel at rtems.org
Wed Jun 21 17:52:16 UTC 2017


---
 testsuites/psxtests/psximfs02/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c
index 2316eb5..d9bb4db 100644
--- a/testsuites/psxtests/psximfs02/init.c
+++ b/testsuites/psxtests/psximfs02/init.c
@@ -74,8 +74,8 @@ rtems_task Init(
   rtems_test_assert( status == 0 );
 
   for( i = 1 ; ; ++i ) {
-    sprintf( linkname_p, "dir01-link%d", i-1 );
-    sprintf( linkname_n, "dir01-link%d", i );
+    sprintf( linkname_p, "dir01-link%04d", i-1 );
+    sprintf( linkname_n, "dir01-link%04d", i );
     printf( "\nCreating link %s for %s\n", linkname_n, linkname_p );
     status = link( linkname_p, linkname_n );
     if( status != 0 ) {
-- 
1.8.3.1




More information about the devel mailing list