Skip to contentSkip to conversation

net: Correct size of NFS buffers

PATCH New Joe Hershberger 2 participants 3 messages Aug 30, 2017 – Sep 8, 2017 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Correct size of NFS buffers

Reported-by Coverity (CID: 152888)

---

 net/nfs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/nfs.h +2 -2
index 70a1a6d..a773cfb 100644
@@ -59,7 +59,7 @@ enum rpc_accept_stat {
 
 struct rpc_t {
 	union {
-		uint8_t data[2048];
+		uint8_t data[NFS_READ_SIZE + 6 * sizeof(uint32_t)];
 		struct {
 			uint32_t id;
 			uint32_t type;
@@ -76,7 +76,7 @@ struct rpc_t {
 			uint32_t verifier;
 			uint32_t v2;
 			uint32_t astatus;
-			uint32_t data[NFS_READ_SIZE];
+			uint32_t data[NFS_READ_SIZE / sizeof(uint32_t)];
 		} reply;
 	} u;
 } __attribute__((packed));
Signature · 1 line
1.7.11.5
#2 lore raw

PATCH 1/1 net: Correct size of NFS buffers

Quoted 7 lines · Joe Hershberger

Hey Tom,

Quoted 2 lines · Joe Hershberger
Reported-by Coverity (CID: 152888)

Any comment on this or the other coverity fix?

Yes, thanks for correcting my fixes! :) They're not so critical that they need to come in before release. Thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170907/2bc739b2/attachment.sig>