Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#107 nullpointer access on HtHTTP:_cookie_jar

resolved
closed-fixed
htdig (103)
5
2002-09-19
2002-02-09
Peter J. Holzer
No

version 3.2.0b4.

When trying to index https pages, htdig segfaults on
trying to retrieve robots.txt. Apparently cookie_jar is
never set to a non-null value (but for some reason
htdig doesn't segfault for non-SSL connections):

% /opt/www/bin/htdig -vvv -i -c ~/tmp/test.conf
ht://dig Start Time: Sat Feb 9 23:50:39 2002
1:1:https://www.wifo.ac.at/
New server: www.wifo.ac.at, 443
- Persistent connections: enabled
- HEAD before GET: disabled
- Timeout: 30
- Connection space: 0
- Max Documents: -1
- TCP retries: 1
- TCP wait time: 5
Trying to retrieve robots.txt file
Making HTTPS request on https://www.wifo.ac.at/robots.txt
zsh: segmentation fault (core dumped)
/opt/www/bin/htdig -vvv -i -c /home/hjp/tmp/test.conf
% gdb /opt/www/bin/htdig core
GNU gdb 4.18
[...]
#0 0x400216c6 in HtHTTP::SetRequestCommand
(this=0x80e7808, cmd=@0xbfffec88) at HtHTTP.cc:616
616
_cookie_jar->SetHTTPRequest_CookiesString(_url, cmd);
(gdb) p _cookie_jar
$1 = (HtCookieJar *) 0x0
(gdb) bt
#0 0x400216c6 in HtHTTP::SetRequestCommand
(this=0x80e7808, cmd=@0xbfffec88) at HtHTTP.cc:616
#1 0x40020b97 in HtHTTP::HTTPRequest (this=0x80e7808)
at HtHTTP.cc:330
#2 0x40020650 in HtHTTP::Request (this=0x80e7808) at
HtHTTP.cc:174
#3 0x804e347 in Document::Retrieve (this=0xbfffeda4,
server=0x80e71e0, date={Ht_t = -1073746392,
local_time = false, static days = 0x40205240,
_vptr. = 0xbfffeea4}) at Document.cc:487
#4 0x8057866 in Server::Server (this=0x80e71e0,
u=0xbfffeea4, local_robots_files=0x0) at Server.cc:120
#5 0x8052aeb in Retriever::Initial (this=0xbffff428,
list=@0xbffff6e8, from=1) at Retriever.cc:179
#6 0x8059d4e in main (ac=5, av=0xbffff7d4) at htdig.cc:289
(gdb)

Discussion

  • Logged In: YES
    user_id=21420

    What snapshot of 3.2.0b4 are you using? These line numbers certainly do not correspond to recent changes in HtHTTP.cc and there have been recent changes. I do not know if they affect this bug, but it's necessary to know what snapshot you are using.

    -Geoff

     
    • assigned_to: nobody --> angusgb
     
  • Logged In: YES
    user_id=59491

    Sorry, this was an old snapshot (102101) included with redhat
    7.2.

    I got a current snapshot (and the current version from CVS),
    but had no luck building it with SSL yet (see bug 515366),
    so I don't know if this bug is still there. You can ignore
    this bug for now.

     
    • milestone: --> resolved
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=28915

    Geoff,

    I have added all the possible checks for this in the code (the
    last today). I think we may assume it is working and close this
    bug.

    Ciao
    -Gabriele