RE: RFR 8007606 : Handle realloc() failure in unix/native/libnet/net_util_md.c correctly

2019-01-16 Thread Baesken, Matthias
Hi  Ivan ,looks good to me too  (not a Reviewer  however).

Do you think we should address the other reallocs with unhandeled  return  code 
?

Best regards, Matthias

> -Original Message-
> From: Langer, Christoph
> Sent: Dienstag, 15. Januar 2019 20:58
> To: Ivan Gerasimov ; Baesken, Matthias
> ; net-dev@openjdk.java.net
> Subject: RE: RFR 8007606 : Handle realloc() failure in
> unix/native/libnet/net_util_md.c correctly
> 
> Hi Ivan,
> 
> yes, sure, push it 😊
> 
> Best regards
> Christoph
> 
> > -Original Message-
> > From: Ivan Gerasimov 
> > Sent: Dienstag, 15. Januar 2019 20:53
> > To: Baesken, Matthias ; net-
> > d...@openjdk.java.net; Langer, Christoph 
> > Subject: Re: RFR 8007606 : Handle realloc() failure in
> > unix/native/libnet/net_util_md.c correctly
> >
> > Hello!
> >
> > Do you think it is good to go now?
> >
> > With kind regards,
> >
> > Ivan
> >
> >
> > On 1/11/19 11:30 AM, Ivan Gerasimov wrote:
> > > Good catch, thank you!
> > >
> > > Indeed, if we don't reset localifsSize then we could end up accessing
> > > already freed memory, which is worse than just a memory leak.
> > >
> > > Here's the updated webrev:
> > >
> > > http://cr.openjdk.java.net/~igerasim/8007606/01/webrev/
> > >
> > > With kind regards,
> > > Ivan
> > >
> > > On 1/11/19 4:43 AM, Baesken, Matthias wrote:
> > >> Hi Ivan,
> > >>
> > >> Shouldn't you resetlocalifsSize to 0   in case of  the early
> > >> return ?  The comment says  localifsSize is the size of the array so
> > >> the size of the array is 0 again after freeing.
> > >>
> > >>
> > >> 637 static struct localinterface *localifs = 0;
> > >>   638 static int localifsSize = 0;/* size of array */
> > >>   639 static int nifs = 0;/* number of entries used in
> > >> array */
> > >>
> > >> ...
> > >>
> > >> 679 if (localifsTemp == 0) {
> > >>   680 free(localifs);
> > >>   681 localifs = 0;
> > >>   682 nifs = 0;
> > >>   683 fclose(f);
> > >>   684 return;
> > >>   685 }
> > >>
> > >>
> > >>
> > >>
> > >> Best regards, Matthias
> > >>
> > >>
> > >>
> > >>> Date: Thu, 10 Jan 2019 20:29:08 -0800
> > >>> From: Ivan Gerasimov 
> > >>> To: "net-dev@openjdk.java.net" 
> > >>> Subject: RFR 8007606 : Handle realloc() failure in
> > >>> unix/native/libnet/net_util_md.c correctly
> > >>> Message-ID: <3dc3c26b-fea7-2538-2c7a-bfa623f2f...@oracle.com>
> > >>> Content-Type: text/plain; charset=utf-8; format=flowed
> > >>>
> > >>> Hello!
> > >>>
> > >>> This seems to be the last use of realloc() without proper handling of a
> > >>> failure.
> > >>>
> > >>> Would you please help review a trivial fix?
> > >>>
> > >>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8007606
> > >>> WEBREV: http://cr.openjdk.java.net/~igerasim/8007606/00/webrev/
> > >>>
> > >>> Thanks in advance!
> > >>>
> > >>> --
> > >>> With kind regards,
> > >>> Ivan Gerasimov
> > >>>
> > >>>
> > >>
> > >
> >
> > --
> > With kind regards,
> > Ivan Gerasimov
> 



Re: [13] RFR: 8217094: HttpClient SSL race if a socket IOException is raised before ALPN is available

2019-01-16 Thread Chris Hegarty




On 15/01/2019 16:52, Daniel Fuchs wrote:

Hi,

Please find below a fix for:

8217094: HttpClient SSL race if a socket IOException is raised
  before ALPN is available
https://bugs.openjdk.java.net/browse/JDK-8217094

webrev:
http://cr.openjdk.java.net/~dfuchs/webrev_8217094/webrev.00/


I think this is good Daniel.

-Chris.


RFR: 8217237 HttpClient does not deal well with multi-valued WWW-Authenticate challenge headers

2019-01-16 Thread Michael McMahon

Could I get the following change reviewed please?

http://cr.openjdk.java.net/~michaelm/8217237/webrev.1/

Thanks,

Michael


Re: RFR: 8217237 HttpClient does not deal well with multi-valued WWW-Authenticate challenge headers

2019-01-16 Thread Daniel Fuchs

Hi Michael,

I believe the code changes looks good.

WRT to the test:

 150 if (response.statusCode() != 200 && 
!response.body().equals(server.response())) {


I believe you meant || not &&

best regards,

-- daniel

On 16/01/2019 16:46, Michael McMahon wrote:

Could I get the following change reviewed please?

http://cr.openjdk.java.net/~michaelm/8217237/webrev.1/

Thanks,

Michael




Re: RFR 8007606 : Handle realloc() failure in unix/native/libnet/net_util_md.c correctly

2019-01-16 Thread Ivan Gerasimov

Thank you Christoph and Mattias!

I've filed
https://bugs.openjdk.java.net/browse/JDK-8217291 and
https://bugs.openjdk.java.net/browse/JDK-8217292

to handle the realloc() issues in other areas.

With kind regards,
Ivan

On 1/16/19 2:22 AM, Baesken, Matthias wrote:

Hi  Ivan ,looks good to me too  (not a Reviewer  however).

Do you think we should address the other reallocs with unhandeled  return  code 
?

Best regards, Matthias


-Original Message-
From: Langer, Christoph
Sent: Dienstag, 15. Januar 2019 20:58
To: Ivan Gerasimov ; Baesken, Matthias
; net-dev@openjdk.java.net
Subject: RE: RFR 8007606 : Handle realloc() failure in
unix/native/libnet/net_util_md.c correctly

Hi Ivan,

yes, sure, push it 😊

Best regards
Christoph


-Original Message-
From: Ivan Gerasimov 
Sent: Dienstag, 15. Januar 2019 20:53
To: Baesken, Matthias ; net-
d...@openjdk.java.net; Langer, Christoph 
Subject: Re: RFR 8007606 : Handle realloc() failure in
unix/native/libnet/net_util_md.c correctly

Hello!

Do you think it is good to go now?

With kind regards,

Ivan


On 1/11/19 11:30 AM, Ivan Gerasimov wrote:

Good catch, thank you!

Indeed, if we don't reset localifsSize then we could end up accessing
already freed memory, which is worse than just a memory leak.

Here's the updated webrev:

http://cr.openjdk.java.net/~igerasim/8007606/01/webrev/

With kind regards,
Ivan

On 1/11/19 4:43 AM, Baesken, Matthias wrote:

Hi Ivan,

Shouldn't you resetlocalifsSize to 0   in case of  the early
return ?  The comment says  localifsSize is the size of the array so
the size of the array is 0 again after freeing.


637 static struct localinterface *localifs = 0;
   638 static int localifsSize = 0;/* size of array */
   639 static int nifs = 0;/* number of entries used in
array */

 ...

679 if (localifsTemp == 0) {
   680 free(localifs);
   681 localifs = 0;
   682 nifs = 0;
   683 fclose(f);
   684 return;
   685 }




Best regards, Matthias




Date: Thu, 10 Jan 2019 20:29:08 -0800
From: Ivan Gerasimov 
To: "net-dev@openjdk.java.net" 
Subject: RFR 8007606 : Handle realloc() failure in
 unix/native/libnet/net_util_md.c correctly
Message-ID: <3dc3c26b-fea7-2538-2c7a-bfa623f2f...@oracle.com>
Content-Type: text/plain; charset=utf-8; format=flowed

Hello!

This seems to be the last use of realloc() without proper handling of a
failure.

Would you please help review a trivial fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8007606
WEBREV: http://cr.openjdk.java.net/~igerasim/8007606/00/webrev/

Thanks in advance!

--
With kind regards,
Ivan Gerasimov



--
With kind regards,
Ivan Gerasimov


--
With kind regards,
Ivan Gerasimov