summaryrefslogtreecommitdiff
path: root/src/htsparse.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-05-14 17:48:04 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-05-14 17:48:04 +0000
commitfea8122ed35c8a7895fc1195d4257fb6c42fe128 (patch)
tree37736ffc0315ff3696a1b3ea036dfb697083f6a2 /src/htsparse.c
parent7323230eb3c8fc4818d0cf34974497b3782a7279 (diff)
Fixed hashtable corruption because of dirty code directly modifying the host address in memory, leading to have hashtable positions not anymore valid.
This issue was especially triggered when a redirect was processed ("Warning moved treated for .." messages) * closes: #43
Diffstat (limited to 'src/htsparse.c')
-rw-r--r--src/htsparse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/htsparse.c b/src/htsparse.c
index e12e94c..b3778bc 100644
--- a/src/htsparse.c
+++ b/src/htsparse.c
@@ -3606,7 +3606,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
urladr, urlfil, mov_adr, mov_fil);
// canceller lien actuel
error = 1;
- strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
+ hash_invalidate_entry(hashptr, ptr); // invalidate hashtable entry
// noter NOUVEAU lien
//xxc xxc
// set_prio_to=0+1; // protection if the moved URL is an html page!!
@@ -3742,7 +3742,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
//
// canceller lien actuel
error = 1;
- strcpybuff(liens[ptr]->adr, "!"); // caractère bidon (invalide hash)
+ hash_invalidate_entry(hashptr, ptr); // invalidate hashtable entry
//
} else { // oups erreur, plus de mémoire!!
printf("PANIC! : Not enough memory [%d]\n", __LINE__);