8170495: JNI primitive type mismatch in SocketDispatcher.c:187
authorbpb
Tue, 12 Dec 2017 15:43:48 -0800
changeset 48255 971d83666b23
parent 48254 111104f1e033
child 48256 472f74fb6c6b
8170495: JNI primitive type mismatch in SocketDispatcher.c:187 Summary: Cast DWORD 'written' to a jint before adding to 'count' Reviewed-by: alanb, rriggs
src/java.base/windows/native/libnio/ch/SocketDispatcher.c
--- a/src/java.base/windows/native/libnio/ch/SocketDispatcher.c	Tue Dec 12 14:16:24 2017 -0800
+++ b/src/java.base/windows/native/libnio/ch/SocketDispatcher.c	Tue Dec 12 15:43:48 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@
             }
         }
 
-        count += written;
+        count += (jint)written;
         address += written;
 
     } while ((count < total) && (written == MAX_BUFFER_SIZE));