forked from Imagelibrary/rtems
2010-08-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/ctermid.c: Add comment explaining that this use of strcpy() is a potential buffer overrun but because the API does not provide a way to know the length of the user provided buffer, there is nothing we can do about it.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2010-08-27 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libcsupport/src/ctermid.c: Add comment explaining that this use of
|
||||
strcpy() is a potential buffer overrun but because the API does not
|
||||
provide a way to know the length of the user provided buffer, there
|
||||
is nothing we can do about it.
|
||||
|
||||
2010-08-27 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libmisc/shell/main_date.c: Use snprintf() not sprintf().
|
||||
|
||||
@@ -30,6 +30,11 @@ char *ctermid(
|
||||
if ( !s )
|
||||
return ctermid_name;
|
||||
|
||||
/*
|
||||
* We have no way of knowing the length of the user provided buffer.
|
||||
* It may not be large enough but there is no way to know that. :(
|
||||
* So this is a potential buffer owerrun that we can do nothing about.
|
||||
*/
|
||||
strcpy( s, ctermid_name );
|
||||
return s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user