[rtems commit] psximfs02/init.c: Avoid potential string overflow
Joel Sherrill
joel at rtems.org
Thu Jun 22 14:04:33 UTC 2017
Module: rtems
Branch: master
Commit: 9d945b5fff11b8a435db03c10a3c8be2a5141122
Changeset: http://git.rtems.org/rtems/commit/?id=9d945b5fff11b8a435db03c10a3c8be2a5141122
Author: Joel Sherrill <joel at rtems.org>
Date: Thu Jun 15 12:42:26 2017 -0500
psximfs02/init.c: Avoid potential string overflow
---
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 ) {
More information about the vc
mailing list