Fossil SCM
Fix a potential use-after-free problem.
Commit
df12c1b05318862f0c78fb86591c1850e059853e
Parent
abc38398eb95314…
1 file changed
+2
-2
+2
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -338,14 +338,14 @@ | ||
| 338 | 338 | j = strlen(zLine) - 1; |
| 339 | 339 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 340 | 340 | j -= 4; |
| 341 | 341 | zLine[j] = 0; |
| 342 | 342 | } |
| 343 | + fossil_print("redirect with status %d to %s\n", rc, &zLine[i]); | |
| 344 | + url_parse(&zLine[i], 0); | |
| 343 | 345 | transport_close(&g.url); |
| 344 | 346 | 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 | 347 | fSeenHttpAuth = 0; |
| 348 | 348 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 349 | 349 | g.zHttpAuth = get_httpauth(); |
| 350 | 350 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 351 | 351 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 352 | 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 | 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 |