qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: fix incorrect access to pointer
@ 2016-07-15  8:43 Paolo Bonzini
  2016-07-18  5:59 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-07-15  8:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang

This is not dereferencing the pointer, and instead checking only
the value of the pointer.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 net/eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/eth.c b/net/eth.c
index 0be59c2..df81efb 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -211,7 +211,7 @@ void eth_get_protocols(const struct iovec *iov, int iovcnt,
                                      *l4hdr_off, sizeof(l4hdr_info->hdr.tcp),
                                      &l4hdr_info->hdr.tcp);
 
-            if (istcp) {
+            if (*istcp) {
                 *l5hdr_off = *l4hdr_off +
                     TCP_HEADER_DATA_OFFSET(&l4hdr_info->hdr.tcp);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] net: fix incorrect access to pointer
  2016-07-15  8:43 [Qemu-devel] [PATCH] net: fix incorrect access to pointer Paolo Bonzini
@ 2016-07-18  5:59 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2016-07-18  5:59 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel



On 2016年07月15日 16:43, Paolo Bonzini wrote:
> This is not dereferencing the pointer, and instead checking only
> the value of the pointer.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   net/eth.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/eth.c b/net/eth.c
> index 0be59c2..df81efb 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -211,7 +211,7 @@ void eth_get_protocols(const struct iovec *iov, int iovcnt,
>                                        *l4hdr_off, sizeof(l4hdr_info->hdr.tcp),
>                                        &l4hdr_info->hdr.tcp);
>   
> -            if (istcp) {
> +            if (*istcp) {
>                   *l5hdr_off = *l4hdr_off +
>                       TCP_HEADER_DATA_OFFSET(&l4hdr_info->hdr.tcp);
>   

Applied to -net. Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-18  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15  8:43 [Qemu-devel] [PATCH] net: fix incorrect access to pointer Paolo Bonzini
2016-07-18  5:59 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).