[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: pc.dph used after destroyed

From: Max Okumoto <okumoto_at_ucsd.edu>
Date: 2001-12-04 12:59:28 CET

> In function svn_ra_dav__get_props() the variable 'req' becomes
> invalid when ne_propfind_destroy(pc.dph) is called.
>
> But is used several lines down:
> if (404 == ne_get_status(req)->code)

* subversion/libsvn_ra_dav/props.c
  Extract status code from request object before it gets destroyed
  and use that value in the test.

Index: subversion/libsvn_ra_dav/props.c
===================================================================
--- subversion/libsvn_ra_dav/.svn/text-base/props.c.svn-base Sun Dec 2 13:34:41 2001
+++ subversion/libsvn_ra_dav/props.c Tue Dec 4 03:54:50 2001
@@ -312,6 +312,7 @@
   svn_string_t my_url;
   svn_stringbuf_t *url_str;
   ne_request *req;
+ int status_code;
 
   my_url.data = url;
   my_url.len = strlen(url);
@@ -342,6 +343,8 @@
       rv = ne_propfind_allprop(pc.dph, process_results, &pc);
     }
 
+ status_code = ne_get_status(req)->code;
+
   ne_propfind_destroy(pc.dph);
 
   if (rv != NE_OK)
@@ -364,7 +367,7 @@
         }
     }
 
- if (404 == ne_get_status(req)->code)
+ if (404 == status_code)
     return svn_error_createf(SVN_ERR_RA_PROPS_NOT_FOUND, 0, NULL, pool,
                              "Failed to fetch props for '%s'", url_str->data);
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:51 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.