mirror of https://github.com/rkd77/elinks.git synced 2024-07-13 14:34:35 -04:00
Go to file
Kalle Olavi Niemitalo 00f5831812 Bug 1053: Fix crash when download ends prematurely.
Call stacks reported by valgrind:

==14702==    at 0x80DD791: read_from_socket (socket.c:945)
==14702==    by 0x8104D0C: read_more_http_data (http.c:1180)
==14702==    by 0x81052FE: read_http_data (http.c:1388)
==14702==    by 0x80DD69B: read_select (socket.c:910)
==14702==    by 0x80D27AA: select_loop (select.c:307)
==14702==    by 0x80D1ADE: main (main.c:358)
==14702==  Address 0x4F4E598 is 56 bytes inside a block of size 81 free'd
==14702==    at 0x402210F: free (vg_replace_malloc.c:233)
==14702==    by 0x812BED8: debug_mem_free (memdebug.c:484)
==14702==    by 0x80D7C82: done_connection (connection.c:479)
==14702==    by 0x80D8A44: abort_connection (connection.c:769)
==14702==    by 0x80D99CE: cancel_download (connection.c:1053)
==14702==    by 0x8110EB6: abort_download (download.c:143)
==14702==    by 0x81115BC: download_data_store (download.c:337)
==14702==    by 0x8111AFB: download_data (download.c:446)
==14702==    by 0x80D7B33: notify_connection_callbacks (connection.c:458)
==14702==    by 0x80D781E: set_connection_state (connection.c:388)
==14702==    by 0x80D7132: set_connection_socket_state (connection.c:234)
==14702==    by 0x80DD78D: read_from_socket (socket.c:943)

read_from_socket() attempted to read socket->fd in order to set
handlers on it, but the socket had already been freed.  Incidentally,
socket->fd was -1, which would have resulted in an assertion failure
if valgrind hadn't caught the bug first.

To fix this, add a list of weak references to sockets.
read_from_socket() registers a weak reference on entry and unregisters
it before exit.  done_socket() breaks any weak references to the
specified socket.  read_from_socket() then checks whether the weak
reference was broken, and doesn't access the socket any more if so.
2008-10-04 14:19:00 +03:00
config Win32: Get socklen_t from <ws2tcpip.h>. 2007-07-18 00:41:08 +03:00
contrib Move most of contrib/smjs/README into the manual. 2008-07-10 20:31:22 +03:00
doc Upgrade ISC licence to July 2007 version 2008-09-28 23:16:37 +03:00
po Upgrade ISC licence to July 2007 version 2008-09-28 23:16:37 +03:00
src Bug 1053: Fix crash when download ends prematurely. 2008-10-04 14:19:00 +03:00
test Remove unclearly licensed test files. 2008-10-03 10:39:12 +03:00
Unicode Relicense my Perl scripts to ISC license 2008-03-23 13:28:06 +02:00
.gitignore Autogenerate .vimrc files and put the master in config/vimrc 2006-01-15 18:38:58 +01:00
.mailmap Add .mailmap file to help git-shortlog 2007-04-15 22:08:11 +02:00
ABOUT-NLS Initial commit of the HEAD branch of the ELinks CVS repository, as of 2005-09-15 15:58:31 +02:00
AUTHORS AUTHORS: Add a licensing statement. 2008-09-29 00:47:59 +03:00
autogen.sh autogen.sh: Also remove autom4te.cache. 2007-07-19 21:28:33 +03:00
BUGS Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
ChangeLog Remove Cogito from ChangeLog and INSTALL too 2008-07-01 02:17:51 +03:00
configure.in fix mangled indentation in configure --help 2008-09-27 15:53:17 +03:00
COPYING Clarify the GPL upgrades policy a bit, and propose an addition 2005-09-17 03:33:36 +02:00
features.conf lzma: rephrase note about LZMA SDK 2008-03-01 13:55:01 +02:00
INSTALL INSTALL: autoconf-2.13 has not been supported for a while 2008-07-01 02:21:46 +03:00
Makefile Document that GNU Make >= 3.78 is needed, and check it. 2007-12-09 08:16:29 +02:00
Makefile.config.in Use git tools instead of cogito for getting the build ID 2008-03-01 13:55:16 +02:00
Makefile.lib Continue if a test fails 2008-07-03 01:55:03 +02:00
NEWS NEWS: mention Samba GPLv2 incompatibility 2008-10-03 00:40:53 +03:00
README Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
SITES SITES: delete or replace dead links 2008-06-30 20:36:47 +03:00
THANKS THANKS: Remove link to HSTI webpage as the domain is for sale. 2006-11-08 20:53:01 +02:00
TODO TODO: minor rephrasing and cleanups 2007-05-28 12:04:43 +02:00

ELinks - an advanced web browser

ELinks is an advanced and well-established feature-rich text mode web
(HTTP/FTP/..) browser. ELinks can render both frames and tables, is highly
customizable and can be extended via scripts. It is very portable and runs
on a variety of platforms.

The ELinks official website is available at


Please see the SITES file for mirrors or other recommended sites.  If you
want to install ELinks on your computer, see the INSTALL file for further

A good start point is documentation files available in doc/, especially the
file named index.txt.

If you want to request features or report bugs, see community information at
http://elinks.cz/community.html and feedback information available at

If you want to write some patches, please first read the doc/hacking.txt

If you want to add a new language or update the translation for an existing
one, please read po/README document.

If you want to write some documentation, well, you're welcome! ;)

Historical notes

Initially, ELinks was a development version of Links (Lynx-like text WWW
browser), with more liberal features policy and development style.  Its purpose
was to provide an alternative to Links, and to test and tune various new
features, but still provide good rock-solid releases inside stable branches.

Why not contribute to Links instead?  Well, first I made a bunch of patches for
the original Links, but Mikulas wasn't around to integrate them, so I started
releasing my fork. When he came back, a significant number of them got refused
because Mikulas did not like them, as he just wouldn't have any use for them
himself.  He wants to keep Links with a relatively closed feature set and merge
only new features which he himself needs.  It has advantages that the tree is
very narrow and the code is small and contains very little bloat.

ELinks, on the contrary, aims to provide a full-featured web browser, superior
to both lynx and w3m and with the power (but not slowness and memory usage) of
Mozilla, Konqueror and similar browsers. However, to prevent drastic bloating
of the code, the development is driven in the course of modularization and
separation of add-on modules (like cookies, bookmarks, ssl, scripting etc).

For more details about ELinks history, please see


If you are more interested in the history and various Links clones and versions,
you can examine the website at


vim: textwidth=80