mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
warc: Fix segfault if CDX record is not found.
This commit is contained in:
parent
ee9d4a9057
commit
1d14c18d7f
@ -1,3 +1,7 @@
|
||||
2012-05-30 Gijs van Tulder <gvtulder@gmail.com>
|
||||
|
||||
* warc.c: Fix segfault if CDX record is not found.
|
||||
|
||||
2011-05-26 Steven Schweda <sms@antinode.info>
|
||||
* connect.c [HAVE_SYS_SOCKET_H]: Include <sys/socket.h>.
|
||||
[HAVE_SYS_SELECT_H]: Include <sys/select.h>.
|
||||
|
@ -1001,10 +1001,10 @@ warc_find_duplicate_cdx_record (char *url, char *sha1_digest_payload)
|
||||
|
||||
char *key;
|
||||
struct warc_cdx_record *rec_existing;
|
||||
hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload, &key,
|
||||
&rec_existing);
|
||||
int found = hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload,
|
||||
&key, &rec_existing);
|
||||
|
||||
if (rec_existing != NULL && strcmp (rec_existing->url, url) == 0)
|
||||
if (found && strcmp (rec_existing->url, url) == 0)
|
||||
return rec_existing;
|
||||
else
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user