Changeset 7a0df6b in rtems
- Timestamp:
- Aug 6, 2015, 2:17:41 AM (4 years ago)
- Branches:
- 4.11
- Children:
- 9ccdb1d
- Parents:
- c9318aa
- git-author:
- Nick Withers <nick.withers@…> (08/06/15 02:17:41)
- git-committer:
- Gedare Bloom <gedare@…> (08/06/15 14:49:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libfs/src/nfsclient/src/nfs.c
rc9318aa r7a0df6b 70 70 #include <string.h> 71 71 #include <stdio.h> 72 #include <stdint.h> 72 73 #include <stdlib.h> 73 74 #include <assert.h> … … 2452 2453 char *in = buffer; 2453 2454 2455 if (iop->offset < 0) { 2456 errno = EINVAL; 2457 return -1; 2458 } 2459 2460 if ((uintmax_t) iop->offset >= UINT32_MAX) { 2461 errno = EFBIG; 2462 return -1; 2463 } 2464 2465 if (count > UINT32_MAX - offset) { 2466 count = UINT32_MAX - offset; 2467 } 2468 2454 2469 do { 2455 2470 size_t chunk = count <= NFS_MAXDATA ? count : NFS_MAXDATA; … … 2551 2566 2552 2567 2553 SERP_ARGS(node).writearg.beginoffset 2568 SERP_ARGS(node).writearg.beginoffset = UINT32_C(0xdeadbeef); 2554 2569 if ( LIBIO_FLAGS_APPEND & iop->flags ) { 2555 2570 if ( updateAttr(node, 0) ) { 2556 2571 return -1; 2557 2572 } 2558 SERP_ARGS(node).writearg.offset = SERP_ATTR(node).size; 2573 if (SERP_ATTR(node).size >= UINT32_MAX) { 2574 errno = EFBIG; 2575 return -1; 2576 } 2577 SERP_ARGS(node).writearg.offset = SERP_ATTR(node).size; 2559 2578 } else { 2560 SERP_ARGS(node).writearg.offset = iop->offset; 2561 } 2579 if (iop->offset < 0) { 2580 errno = EINVAL; 2581 return -1; 2582 } 2583 if ((uintmax_t) iop->offset >= UINT32_MAX) { 2584 errno = EFBIG; 2585 return -1; 2586 } 2587 SERP_ARGS(node).writearg.offset = iop->offset; 2588 } 2589 2590 if (count > UINT32_MAX - SERP_ARGS(node).writearg.offset) { 2591 count = UINT32_MAX - SERP_ARGS(node).writearg.offset; 2592 } 2593 2562 2594 SERP_ARGS(node).writearg.totalcount = UINT32_C(0xdeadbeef); 2563 2595 SERP_ARGS(node).writearg.data.data_len = count; … … 2818 2850 sattr arg; 2819 2851 2852 if (length < 0) { 2853 errno = EINVAL; 2854 return -1; 2855 } 2856 2857 if ((uintmax_t) length > UINT32_MAX) { 2858 errno = EFBIG; 2859 return -1; 2860 } 2861 2820 2862 arg.size = length; 2821 2863 /* must not modify any other attribute; if we are not the owner
Note: See TracChangeset
for help on using the changeset viewer.