Avoid buffer overflow when PID exceeds to 4-digit limit.
char array root has to contain at least 'A' + pid + '\0', which only works
pid of testprcess is a 4-digit PID.
PID_MAX_DEFAULT in kernel (when CONFIG_BASE_SMALL is NOT set) is set up to
4 million, which requires at least 7-digit pid.
Author: Frank Seidel <[EMAIL PROTECTED]>
Signed-off-by: Frank Seidel <[EMAIL PROTECTED]>
Signed-off-by: Daniel Gollub <[EMAIL PROTECTED]>
---
testcases/kernel/fs/inode/inode01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: ltp-full-20080916/testcases/kernel/fs/inode/inode01.c
===================================================================
--- ltp-full-20080916.orig/testcases/kernel/fs/inode/inode01.c
+++ ltp-full-20080916/testcases/kernel/fs/inode/inode01.c
@@ -105,7 +105,7 @@ int increment_name(), get_next_name(), m
int main()
{
- char root[6];
+ char root[16]; //as pids can get much longer
int gen_ret_val, ch_ret_val, level;
int ret_val;
int generate(), check();
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list