1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-21 00:25:37 +00:00
Commit Graph

1303 Commits

Author SHA1 Message Date
Jonas Fonseca
2e174e5e05 Bug 869: use safe_strncpy when initializing the program field
This cleans up the previous fix and also fixes the problem mentioned
regarding ELinks still crashing when the first character is removed.

[ Squashed the original fix in, corrected the bug number, and added a
  NEWS entry.  --KON ]
2011-07-15 18:21:31 +03:00
Kalle Olavi Niemitalo
63a5ae0320 mailcap bug 1113: Don't leak values of duplicate fields
If a mailcap entry has two test commands or two descriptions,
free the first one before replacing it with the second one.
2011-05-01 23:29:11 +03:00
Kalle Olavi Niemitalo
2fa81b3f2c Debian bug 464384: fix cast warning in alignof 2011-05-01 23:27:16 +03:00
Kalle Olavi Niemitalo
b02e493cef NEWS: Debian bug 380347 is CVE-2008-7224 2009-10-06 08:12:32 +03:00
Kalle Olavi Niemitalo
b9d9092a12 NEWS: ELinks 0.11.7 was released on 2009-08-22 2009-08-22 14:57:53 +03:00
Kalle Olavi Niemitalo
214443fc01 ELinks 0.11.7.GIT 2009-08-22 14:39:19 +03:00
Kalle Olavi Niemitalo
7b6a76da4b ELinks 0.11.7 2009-08-22 14:15:08 +03:00
Kalle Olavi Niemitalo
a35e0d432e NEWS: ELinks 0.11.7 2009-08-22 14:02:46 +03:00
Kalle Olavi Niemitalo
8766e3829f bug 764, LUA: option_types[OPT_INT].set needs long *
l_set_option() was passing the address of an int to
option_types[OPT_INT].set and option_types[OPT_BOOL].set.
That looks correct but is not: both function pointers
point to num_set(), which actually reads *(long *) str.
Change l_set_option() to pass the address of a long instead,
and add comments about this dependency.
2009-08-20 22:44:46 +03:00
Kalle Olavi Niemitalo
9e52956a02 bug 764: Initialize the right member of union option_value
Convert the initial value of each option to void * at compile time,
and make register_options() convert it back and set the appropriate
member of union option_value.  Previously, all initial values were
left in option.value.tree and then read directly from other members
of the union, failing badly on big-endian 64-bit systems.
2009-08-18 07:46:43 +03:00
Laurent MONIN
39d03147bb LONG/INT: fix compilation under AMD64, reported by Miciah.
(cherry picked from commit 1ec1dc43be)
2009-08-11 03:50:01 +03:00
Laurent MONIN
9dab353f15 LUA: use long instead of int with OPT_LONG.
(cherry picked from commit bd38ed5b17)
2009-08-11 03:48:56 +03:00
Laurent MONIN
e4894d0414 config/options: use struct option big_number field instead of number
field where OPT_LONG is used.

(cherry picked from commit 2454ceffb7)
2009-08-11 03:48:55 +03:00
Laurent MONIN
174b34a2e6 config/options: add_opt() casts value to long then store in int... see
bug 764. Micro step to a fix.

(cherry picked from commit cde9db3d70)
2009-08-11 03:48:55 +03:00
Laurent MONIN
6b6473d02c config/options: arrange add_opt() to use only mem_free() instead of
delete_option() in case of allocation failure.

(cherry picked from commit 6637272c5a)
2009-08-11 03:48:55 +03:00
Laurent MONIN
5c125ac0b2 config/options: add_opt() @min and @max parameters have to be long to
match struct option.

(cherry picked from commit c3cf5b9474)
2009-08-11 03:48:41 +03:00
Kalle Olavi Niemitalo
23f9591a3e autogen.sh: Also remove autom4te.cache.
To stop it from getting in elinks-*.tar.gz.
(cherry picked from commit f7a16ba0e6)
2009-06-03 10:54:07 +03:00
Kalle Olavi Niemitalo
94c7e0d2a7 bug 1077: NEWS entry 2009-05-10 08:58:14 +03:00
Witold Filipczyk
ceb4ba2336 No segfault
At the end of the destroy_vs there two assignments vs->doc_view->vs = NULL and
vs->doc_view = NULL. In the setup_session the copy_vs left the vs "unbound"
with any variable. At least one of these two is wrong.
2009-05-10 08:53:41 +03:00
Kalle Olavi Niemitalo
00140ad8e9 VERSION=0.11.6.GIT in configure.in 2009-03-23 09:38:15 +02:00
Kalle Olavi Niemitalo
00a3307531 NEWS: ELinks 0.11.6 was released on 2009-03-21.
That's the date in the elinks-users mailing list archive at
http://linuxfromscratch.org/pipermail/elinks-users/2009-March/001801.html
anyway.
2009-03-22 00:43:14 +02:00
Kalle Olavi Niemitalo
6ae8ce564a ELinks 0.11.6 2009-03-21 14:31:54 +02:00
Kalle Olavi Niemitalo
f9c5e8c58c NEWS: ELinks 0.11.6 2009-03-21 14:16:20 +02:00
Kalle Olavi Niemitalo
5a320b6ec0 bug 1047: inline functions C99 conformance
C99 6.7.4p3 sets some constraints on what can be done in inline
functions, and the Sun C compiler on OpenSolaris is reported to take
those constraints seriously.  See the elinks-dev thread "Patch for
porting Elinks to OpenSolaris" that started on 2009-02-18.
2009-03-12 23:35:53 +02:00
Kalle Olavi Niemitalo
a2404407ce Fix double-free crash if EOF immediately follows </MAP>.
look_for_link() used to return 0 both when it found the closing </MAP>
tag, and when it hit the end of the file.  In the first case, it also
added *menu to the memory_list; in the second case, it did not.  The
caller get_image_map() supposedly distinguished between these cases by
checking whether pos >= eof, and freed *menu separately if so.

However, if the </MAP> was at the very end of the HTML file, so that
not even a newline followed it, then look_for_link() left pos == eof
even though it had found the </MAP> and added *menu to the memory_list.
This made get_image_map() misinterpret the result and mem_free(*menu)
even though *menu had already been freed as part of the memory_list;
thus the crash.

To fix this, make look_for_link() return -1 instead of 0 if it hits
EOF without finding the </MAP>.  Then make get_image_map() check the
return value instead of comparing pos to eof.  And add a test case,
although not an automated one.

Alternatively, look_for_link() could have been changed to decrement
pos between finding the </MAP> and returning 0.  Then, the pos >= eof
comparison in get_image_map() would have been false.  That scheme
would however have been a bit more difficult to understand and
maintain, I think.

Reported by Paul B. Mahol.
2008-12-31 20:06:49 +00:00
Kalle Olavi Niemitalo
4086418069 mouse: Exit cursor-routing mode when a link is clicked
Before this patch, if you first moved the cursor to link X with
move-cursor-up and similar actions, and then clicked link Y with the
mouse, ELinks would activate link X, i.e. not the one you clicked.
This happened because the NAVIGATE_CURSOR_ROUTING mode was left
enabled and made ELinks ignore the doc_view->vs->current_link
member that ELinks had updated according to the click.
Make ELinks return the session to NAVIGATE_LINKWISE mode, so that
the update takes effect.

Reported by Paul B. Mahol.
2008-12-28 12:49:29 +02:00
Kalle Olavi Niemitalo
05c9ae52d5 Bug 1004: Rewrite FSF code to avoid GPLv2 2. c)
c_strcasecmp and c_strncasecmp were taken from GNU coreutils 6.9,
which is copyrighted by the Free Software Foundation and licensed
under GNU GPL version 2 or later.  It seems the programs in coreutils
do not normally read commands interactively.  So, including coreutils
code in an interactive program such as ELinks could trigger GPLv2
section 2. c), which would require ELinks to display a copyright
notice and a warranty disclaimer each time it is started.  Rewrite
those functions to remove the FSF-copyrighted code and make ELinks
not a work based on GNU coreutils.

Avoiding FSF code has the additional benefit that we won't have to ask
FSF for permission if we want to add a licence exception that allows
linking ELinks with OpenSSL.  So it seems a good idea even if my
interpretation of GPLv2 2. c) is overly strict.  I haven't checked
though whether there are other FSF-copyrighted portions in ELinks.
(cherry picked from commit c56f3928ec)
2008-11-02 22:34:22 +02:00
Kalle Olavi Niemitalo
b1ac29be47 Bug 1004: NEWS and AUTHORS
The licensing statement is from comment #18 of bug 1004.
2008-11-01 21:23:12 +02:00
M. Vefa Bicakci
5bd3425540 Patch 3: Further fixes including strcasestr and convert_to_lowercase 2008-11-01 21:23:12 +02:00
Kalle Olavi Niemitalo
a3abd3b275 Bug 1004: Fix implicit declarations of c_* functions
Add #include directives to fix these errors:

      [CC]   src/intl/gettext/l10nflist.o
cc1: warnings being treated as errors
.../src/intl/gettext/l10nflist.c: In function ‘_nl_normalize_codeset’:
.../src/intl/gettext/l10nflist.c:352: error: implicit declaration of function ‘c_tolower’

      [CC]   src/dom/css/scanner.o
cc1: warnings being treated as errors
In file included from .../src/dom/scanner.h:4,
                 from .../src/dom/css/scanner.h:5,
                 from .../src/dom/css/scanner.c:12:
.../src/dom/string.h: In function ‘dom_string_casecmp’:
.../src/dom/string.h:25: error: implicit declaration of function ‘c_strncasecmp’
2008-11-01 21:21:59 +02:00
M. Vefa Bicakci
8a03bea170 Patch 2: Modifications to the remaining parts of ELinks 2008-11-01 19:52:06 +02:00
M. Vefa Bicakci
f957ffbe4b Patch 1: Finalize modifications to the HTML parser 2008-11-01 19:52:06 +02:00
M. Vefa Bicakci
3dc7f2d85f Patch 0: Partial modification of the HTML parser and modification of the FastFind subsystem 2008-11-01 19:52:06 +02:00
Kalle Olavi Niemitalo
3615e17c31 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.
(cherry picked from commit 00f5831812)
2008-10-04 14:52:05 +03:00
Kalle Olavi Niemitalo
faebee18d1 Remove unclearly licensed test files.
test/align.html: from www.czech-tv.cz
test/css/idnes_mail.html: apparently from idnes.cz
test/erreurs_en.htm: unclear origin
test/javascript_broken.html: presumably from www.hotjobs.com
test/poocs.net.html: presumably from poocs.net

I did not find in the source tree a licence to distribute any of these.
(cherry picked from commit 22975bb0ec)
2008-10-03 10:56:05 +03:00
Kalle Olavi Niemitalo
6e2476ea4d Bug 1053: Fix crash when download ends.
ELinks attempted to display a message box on file_download.term, but
it had already closed that terminal and freed the struct terminal.  To
fix this, reset file_download.term pointers to NULL when the terminal
is about to be destroyed.  Also, assert in download_data_store() that
file_download.term is either NULL or in the global "terminals" list.

Reported by أحمد المحمودي.
2008-10-02 23:39:58 +03:00
Kalle Olavi Niemitalo
983419b606 test/optgroup.html is under GNU Free Documentation License
test/optgroup.html was added on 2004-04-17 with no comment about licensing.
I contacted the author via <http://iccl.fi/feedback.cgi?id=mail>, asking
for a licence.  The author noted that a developer of ELinks had originally
asked on the #debian.fi channel whether the file could be used, and he had
allowed it then.  That permission grant had not been recorded in the source
tree though, and it is not clear whether modification had been allowed.
Anyway, the author now explicitly grants us the GNU free documentation
licence on this file, and is willing to consider other licences.
(cherry picked from commit fe78a0249a)
2008-09-28 22:00:35 +03:00
Kalle Olavi Niemitalo
66b5d9f649 ELinks 0.11.5 release date 2008-09-21 20:58:03 +03:00
Kalle Olavi Niemitalo
baba32e2fc ELinks 0.11.5.GIT 2008-09-21 00:27:40 +03:00
Kalle Olavi Niemitalo
5ddd54a1f8 ELinks 0.11.5 2008-09-20 23:58:02 +03:00
Kalle Olavi Niemitalo
f17524c7c6 NEWS for ELinks 0.11.5 2008-09-20 23:34:13 +03:00
Kalle Olavi Niemitalo
9ca0182ec6 Don't link with libgnutls-openssl, which is now GPLv3+.
ELinks used to call the MD5 code in libgnutls-openssl, part of
GNUTLS-EXTRA, which was licensed under GNU GPL version 2 or later.
In GnuTLS 2.2.0 however, the license of GNUTLS-EXTRA has been changed
to GNU GPL version 3 or later.  This is no longer compatible with
GNU GPL version 2 as used in the current ELinks, because GPLv2 clause
2. b) requires the whole work to be licensed under GPLv2, and GPLv3
does not allow that.

If anyone is still using a pre-2.2 GnuTLS, he or she can tweak
configure.in to check the version or just assume it's old enough.
There is not much reason to do so though, as including the MD5 code
in ELinks seems to cost only about 4 kilobytes on i686.
2008-08-17 17:36:43 +03:00
Kalle Olavi Niemitalo
fd7968e638 Bug 698: Keep forms contiguous and non-overlapping and start from 0.
In document.forms, each struct form has form_num and form_end members
that reserve a subrange of [0, INT_MAX] to that form.  Previously,
multiple forms in the list could have form_end == INT_MAX and thus
overlap each other.  Prevent that by adjusting form_end of each form
newly added to the list.

Revert 438f039bda,
"check_html_form_hierarchy: Old code was buggy.", which made
check_html_form_hierarchy attach controls to the wrong forms.
Instead, construct the dummy form ("for those Flying Dutchmans") at
form_num == 0 always before adding any real forms to the list.
This prevents the assertion failure by ensuring that every possible
form_control.position is covered by some form, if there are any forms.

Add a function assert_forms_list_ok, which checks that the set of
forms actually covers the [0, INT_MAX] range without overlapping,
as intended.  Call that from check_html_form_hierarchy to detect
any corruption.

I have tested this code (before any cherry-picking) with:
- bug 613 attachment 210: didn't crash
- bug 714 attachment 471: didn't crash
- bug 961 attachment 382: didn't crash
- bug 698 attachment 239: all the submit buttons showed the right URLs
- bug 698 attachment 470: the submit button showed the right URL

(cherry picked from commit 386a5d517b,
 with conflicts)
2008-07-25 22:31:35 +03:00
Kalle Olavi Niemitalo
295c7760f7 1030: List the bug in NEWS. 2008-07-14 22:34:43 +03:00
Kalle Olavi Niemitalo
2aec302d47 1030: Wrap get_search_region_from_search_nodes in #ifdef HAVE_REGEX_H
This change avoids the following error:

gcc -DHAVE_CONFIG_H -I../../.. -I/home/Kalle/src/elinks-0.11/src -I/home/Kalle/prefix/include -I/usr/include/smjs -I/usr/include -I/usr/include/lua50 -I/usr/include -I/usr/include -O0 -ggdb -Wall -Wall -Werror -fno-strict-aliasing -Wno-pointer-sign -Wno-address -fno-strict-overflow -o search.o -c /home/Kalle/src/elinks-0.11/src/viewer/text/search.c
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.11/src/viewer/text/search.c:257: warning: 'get_search_region_from_search_nodes' defined but not used
make[3]: *** [search.o] Error 1
make[3]: Leaving directory `/home/Kalle/build/i686-pc-linux-gnu/elinks-0.11/src/viewer/text'

get_search_region_from_search_nodes is called only from
search_for_pattern, which already was inside #ifdef HAVE_REGEX_H.
2008-07-14 22:26:38 +03:00
Witold Filipczyk
442b0d83b0 1030: Fixed issue with undefined HAVE_REGEX_H. 2008-07-14 22:19:01 +03:00
Kalle Olavi Niemitalo
76c89a6961 config: Count backslashed newlines in str_rd.
If a newline has a backslash in front of it, then str_rd replaces it
with a space.  However, the newline was in the original config file,
so the line number must still be incremented.
(cherry picked from commit 76d803bbb9)
2008-07-11 18:31:50 +03:00
Kalle Olavi Niemitalo
7af9092448 NEWS: mention bug 503
(cherry picked from commit 7e8e52d33f)
2008-07-11 18:31:50 +03:00
Kalle Olavi Niemitalo
a352ac2c64 config: Fix the "include" command.
Previously, it only pretended to rewrite the configuration file, so it
set or cleared OPT_MUST_SAVE but never changed or output any options.
Now, it actually sets the options when ELinks is loading the
configuration file.  Also, when ELinks is rewriting the configuration
file, it now compares the values in the included file to the current
values of the options, and sets or clears OPT_MUST_SAVE accordingly.
(cherry picked from commit 054852ae23)
2008-07-11 18:29:02 +03:00
Kalle Olavi Niemitalo
a4fdf122d1 config: Access OPT_MUST_SAVE in the real option, not alias.
So, if elinks.conf contains a "set" command for an alias and ELinks
updates that, it now knows it doesn't have to append another "set"
command for the underlying option.
(cherry picked from commit 92b430f3dc)
2008-07-11 18:29:02 +03:00