forked from Imagelibrary/rtems
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:
@@ -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>
|
2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* libfs/src/dosfs/msdos_format.c: Address Coverity issue 183 which was
|
* libfs/src/dosfs/msdos_format.c: Address Coverity issue 183 which was
|
||||||
|
|||||||
@@ -16,13 +16,6 @@
|
|||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include "internal.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[])
|
int rtems_shell_main_setenv(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char* env = NULL;
|
char* env = NULL;
|
||||||
@@ -39,7 +32,7 @@ int rtems_shell_main_setenv(int argc, char *argv[])
|
|||||||
env = argv[1];
|
env = argv[1];
|
||||||
|
|
||||||
for (arg = 2; arg < argc; arg++)
|
for (arg = 2; arg < argc; arg++)
|
||||||
len += strnlen(argv[arg], MAX);
|
len += strlen(argv[arg]);
|
||||||
|
|
||||||
len += argc - 2 - 1;
|
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++) {
|
for (arg = 2, p = string; arg < argc; arg++) {
|
||||||
strncpy(p, argv[arg], MAX);
|
strcpy(p, argv[arg]);
|
||||||
p += strnlen(argv[arg], MAX);
|
p += strlen(argv[arg]);
|
||||||
if (arg < (argc - 1)) {
|
if (arg < (argc - 1)) {
|
||||||
*p = ' ';
|
*p = ' ';
|
||||||
p++;
|
p++;
|
||||||
|
|||||||
Reference in New Issue
Block a user