Message ID | 19980930154303.A14398@tantalophile.demon.co.uk |
---|---|
State | New, archived |
Headers | show |
Series |
|
Related | show |
--- /usr/src/linux/fs/devpts/root.c Wed Aug 26 19:18:54 1998 +++ /tmp/root.c Wed Sep 30 15:39:35 1998 @@ -152,12 +152,16 @@ if ( *p < '1' || *p > '9' ) return 0; entry = *p++ - '0'; + if ( entry >= sbi->max_ptys ) + return 0; for ( i = dentry->d_name.len-1 ; i ; i-- ) { if ( *p < '0' || *p > '9' ) return 0; entry *= 10; entry += (*p++ - '0'); + if ( entry >= sbi->max_ptys ) + return 0; } }