cURL / Mailing Lists / curl-library / Single Mail

curl-library

Crash in curl_easy_duphandle + Fix

From: Frank Hempel <lists_at_frankoni.net>
Date: Sat, 28 Apr 2007 17:42:04 +0200

Hello,

I discovered a little coding mistake in curl_easy_duphandle leading to a
crash because of referencing a null pointer.

This problem seemed to be addressed already in version 7.16.2, because
the condition in which the pointer is tested against NULL appeared for
the first time in this latest version, but the two conditions should be
switched in their order to make sense.

So far, Greetings,
Frank

*** easy.c.orig 2007-04-09 23:00:57.000000000 +0200
--- easy.c 2007-04-28 17:26:26.000000000 +0200
*************** CURL *curl_easy_duphandle(CURL *incurl)
*** 636,643 ****
  
    if(fail) {
      if(outcurl) {
! if((outcurl->state.connc->type == CONNCACHE_PRIVATE) &&
! outcurl->state.connc)
          Curl_rm_connc(outcurl->state.connc);
        if(outcurl->state.headerbuff)
          free(outcurl->state.headerbuff);
--- 636,642 ----
  
    if(fail) {
      if(outcurl) {
! if(outcurl->state.connc && (outcurl->state.connc->type == CONNCACHE_PRIVATE))
          Curl_rm_connc(outcurl->state.connc);
        if(outcurl->state.headerbuff)
          free(outcurl->state.headerbuff);
Received on 2007-04-28