Fossil SCM

Fix a potential use-after-free problem.

drh 2015-05-07 19:50 trunk
Commit df12c1b05318862f0c78fb86591c1850e059853e
1 file changed +2 -2
+2 -2
--- src/http.c
+++ src/http.c
@@ -338,14 +338,14 @@
338338
j = strlen(zLine) - 1;
339339
while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340340
j -= 4;
341341
zLine[j] = 0;
342342
}
343
+ fossil_print("redirect with status %d to %s\n", rc, &zLine[i]);
344
+ url_parse(&zLine[i], 0);
343345
transport_close(&g.url);
344346
transport_global_shutdown(&g.url);
345
- fossil_print("redirect with status %d to %s\n", rc, &zLine[i]);
346
- url_parse(&zLine[i], 0);
347347
fSeenHttpAuth = 0;
348348
if( g.zHttpAuth ) free(g.zHttpAuth);
349349
g.zHttpAuth = get_httpauth();
350350
return http_exchange(pSend, pReply, useLogin, maxRedirect);
351351
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352352
--- src/http.c
+++ src/http.c
@@ -338,14 +338,14 @@
338 j = strlen(zLine) - 1;
339 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340 j -= 4;
341 zLine[j] = 0;
342 }
 
 
343 transport_close(&g.url);
344 transport_global_shutdown(&g.url);
345 fossil_print("redirect with status %d to %s\n", rc, &zLine[i]);
346 url_parse(&zLine[i], 0);
347 fSeenHttpAuth = 0;
348 if( g.zHttpAuth ) free(g.zHttpAuth);
349 g.zHttpAuth = get_httpauth();
350 return http_exchange(pSend, pReply, useLogin, maxRedirect);
351 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352
--- src/http.c
+++ src/http.c
@@ -338,14 +338,14 @@
338 j = strlen(zLine) - 1;
339 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
340 j -= 4;
341 zLine[j] = 0;
342 }
343 fossil_print("redirect with status %d to %s\n", rc, &zLine[i]);
344 url_parse(&zLine[i], 0);
345 transport_close(&g.url);
346 transport_global_shutdown(&g.url);
 
 
347 fSeenHttpAuth = 0;
348 if( g.zHttpAuth ) free(g.zHttpAuth);
349 g.zHttpAuth = get_httpauth();
350 return http_exchange(pSend, pReply, useLogin, maxRedirect);
351 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
352

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button