Changeset a47dd1c in rtems


Ignore:
Timestamp:
Mar 15, 2011, 3:43:09 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
d15c084
Parents:
315c9b89
Message:

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

  • libmisc/shell/main_setenv.c: Revert after discussion. Mark as intentional in Coverity.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r315c9b89 ra47dd1c  
     12011-03-15      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libmisc/shell/main_setenv.c: Revert after discussion. Mark as
     4        intentional in Coverity.
     5
    162011-03-15      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/libmisc/shell/main_setenv.c

    r315c9b89 ra47dd1c  
    1717#include "internal.h"
    1818
    19 /*
    20  *  Limit examining or copying more than 256 characters at a time.
    21  *  Yes, this is very arbitrary.  If there are POSIX constants, then
    22  *  they should be used.
    23  */
    24 #define MAX 156
    25 
    2619int rtems_shell_main_setenv(int argc, char *argv[])
    2720{
     
    4033
    4134  for (arg = 2; arg < argc; arg++)
    42     len += strnlen(argv[arg], MAX);
     35    len += strlen(argv[arg]);
    4336
    4437  len += argc - 2 - 1;
     
    5245
    5346  for (arg = 2, p = string; arg < argc; arg++) {
    54     strncpy(p, argv[arg], MAX);
    55     p += strnlen(argv[arg], MAX);
     47    strcpy(p, argv[arg]);
     48    p += strlen(argv[arg]);
    5649    if (arg < (argc - 1)) {
    5750      *p = ' ';
Note: See TracChangeset for help on using the changeset viewer.