<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Right, the important thing is to throw OOM to indicate the memory
allocation failure.<br>
The return value won't matter. If the caller is a Java method, an
OOM will occur when returning from this JNI call. If the caller is
another JNI method, then the caller should check for pending error
condition, i,e. by calling (*env)->ExceptionCheck(env), and do
necessary cleanup before returning to its caller. The pending
exception will be thrown when returning to Java method.<br>
<br>
Valerie<br>
On 02/08/13 09:38, John Zavgren wrote:
<blockquote cite="mid:5115382C.40708@oracle.com" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<div class="moz-cite-prefix">Although I agree that the name:
"GSS_C_NO_CHANNEL_BINDINGS" is misleading,<br>
I can't identify anything else that seems more appropriate. <br>
<br>
The header file:
/jdk8-tl/jdk/src/share/native/sun/security/jgss/wrapper/gssapi.h
defines GSS_C_NO_CHANNEL_BINDINGS as follows:<br>
#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)<br>
<br>
The symbol matches the prototype of the function:<br>
<blockquote><b><font face="Courier 10 Pitch">/*<br>
* Utility routine which creates a gss_channel_bindings_t
structure<br>
* using the specified org.ietf.jgss.ChannelBinding
object.<br>
*/<br>
gss_channel_bindings_t getGSSCB(JNIEnv *env, jobject jcb)
{<br>
gss_channel_bindings_t cb;<br>
jobject jinetAddr;<br>
jbyteArray value;<br>
<br>
if (jcb == NULL) {<br>
return GSS_C_NO_CHANNEL_BINDINGS;<br>
}<br>
cb = malloc(sizeof(struct
gss_channel_bindings_struct));<br>
<br>
if(cb == NULL)<br>
return GSS_C_NO_CHANNEL_BINDINGS;</font></b><br>
</blockquote>
There doesn't appear to be anything in our set of options that
is more suggestive of a memory allocation failure and the
symbol: GSS_C_NO_CHANNEL_BINDINGS seems to be logically correct.<br>
<br>
Ideas?<br>
<br>
On 02/06/2013 04:57 AM, Dmitry Samersoff wrote:<br>
</div>
<blockquote cite="mid:51122920.6040208@oracle.com" type="cite">
<pre wrap="">John,
Not sure GSS_C_NO_CHANNEL_BINDINGS; is correct return value for this case.
I'm second to Valerie - it's better to throw OOM
-Dmitry
On 2013-02-06 03:44, John Zavgren wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Greetings:
I modified the native code to eliminate potential memory loss and crashes by checking the return values of malloc() and realloc() calls.
The webrev image of these changes is visible at:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/%7Ejzavgren/8007607/webrev.01/">http://cr.openjdk.java.net/~jzavgren/8007607/webrev.01/</a>
Thanks!
John Zavgren
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Zavgren
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:john.zavgren@oracle.com">john.zavgren@oracle.com</a>
603-821-0904
US-Burlington-MA</pre>
</blockquote>
<br>
</body>
</html>