2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>

* libmisc/shell/main_setenv.c: Revert after discussion. Mark as
	intentional in Coverity.
This commit is contained in:
Joel Sherrill
2011-03-15 15:43:09 +00:00
parent 315c9b89f3
commit a47dd1cc26
2 changed files with 8 additions and 10 deletions

View File

@@ -1,3 +1,8 @@
2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/shell/main_setenv.c: Revert after discussion. Mark as
intentional in Coverity.
2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/dosfs/msdos_format.c: Address Coverity issue 183 which was

View File

@@ -16,13 +16,6 @@
#include <rtems/shell.h>
#include "internal.h"
/*
* Limit examining or copying more than 256 characters at a time.
* Yes, this is very arbitrary. If there are POSIX constants, then
* they should be used.
*/
#define MAX 156
int rtems_shell_main_setenv(int argc, char *argv[])
{
char* env = NULL;
@@ -39,7 +32,7 @@ int rtems_shell_main_setenv(int argc, char *argv[])
env = argv[1];
for (arg = 2; arg < argc; arg++)
len += strnlen(argv[arg], MAX);
len += strlen(argv[arg]);
len += argc - 2 - 1;
@@ -51,8 +44,8 @@ int rtems_shell_main_setenv(int argc, char *argv[])
}
for (arg = 2, p = string; arg < argc; arg++) {
strncpy(p, argv[arg], MAX);
p += strnlen(argv[arg], MAX);
strcpy(p, argv[arg]);
p += strlen(argv[arg]);
if (arg < (argc - 1)) {
*p = ' ';
p++;