8170495: JNI primitive type mismatch in SocketDispatcher.c:187

Cast DWORD 'written' to a jint before adding to 'count'

Reviewed-by: alanb, rriggs
This commit is contained in:
Brian Burkhalter 2017-12-12 15:43:48 -08:00
parent ddb9702c14
commit ec54b10f21

View File

@ -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 @@ Java_sun_nio_ch_SocketDispatcher_write0(JNIEnv *env, jclass clazz, jobject fdo,
}
}
count += written;
count += (jint)written;
address += written;
} while ((count < total) && (written == MAX_BUFFER_SIZE));