2347 Commits

Author SHA1 Message Date
Azat Khuzhin
765c35d4a8 evbuffer_add_file: munmap() correct size on mmap() failure 2017-12-18 01:53:19 +03:00
Azat Khuzhin
226b927813 evbuffer_add_file: fix endless loop when file does not have such amount of data 2017-12-18 01:29:56 +03:00
Mark Ellzey
7dedc077aa
Backport for #340 (fix overflow check in expand_singlechain()
Refs: #306
Fixes: #340
Fixes: 20d6d44
2016-06-28 11:11:51 -07:00
Azat Khuzhin
9b2a670974 Ignore all pkgconfig generated stuff 2016-05-02 12:37:19 +03:00
Jan Heylen
a5b4b7a1b0 libevent_core and libevent_extra also deserve a pkgconfig file 2016-04-24 10:56:39 +02:00
Azat Khuzhin
f4b28a6c70 Merge remote-tracking branch 'origin/pr/338' into patches-2.0
* origin/pr/338:
  evbuffer_add: Use last_with_datap if set, not last.
  Use the free-trailing-chains function in evbuffer_insert_chain too
  test/regress: add tests for evbuffer_add() breakage on empty last chain

Fixes: #335
2016-03-29 19:27:07 +03:00
Marcus Sundberg
b00db82a83 evbuffer_add: Use last_with_datap if set, not last.
evbuffer_add() would always put data in the last chain, even if there
was available space in a previous chain, and in doing so it also
failed to update last_with_datap, causing subsequent calls to other
functions that do look at last_with_datap to add data in the middle
of the evbuffer instead of at the end.

Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and
evbuffer/add3 tests, and also prevents wasting space available in the
chain pointed to by last_with_datap.
2016-03-26 20:49:27 +01:00
Nick Mathewson
0e894fb7f3 Use the free-trailing-chains function in evbuffer_insert_chain too 2016-03-26 20:49:08 +01:00
Marcus Sundberg
0091da360a test/regress: add tests for evbuffer_add() breakage on empty last chain
The evbuffer/add* tests currenly break on 2.0.21, 2.0.22 and 2.1 HEAD
due to issue #335. The evbuffer/reference2 test breaks on 2.0.21 and
2.0.22 due to commit b18c04dd not being applied.
2016-03-26 20:48:01 +01:00
Azat Khuzhin
a4a7c1aedd Merge branch 'fix-http-for-ipv6-backport-for-2.0' into patches-2.0
This patchset is just a backport from upstream (with minor fixes to function
names in tests) of 2ecd894725e167dcc1f22f9292f98e41299df6cc ("Merge pull
request #39 from azat/fix-http-for-ipv6")

* fix-http-for-ipv6-backport-for-2.0:
  Add regress test ipv6_for_domain.
  Fix ipv6 support for http. When URL contain domain, not IP address.

Fixes #287
2015-10-08 11:51:55 +03:00
Azat Khuzhin
066a4f6fd1 Add regress test ipv6_for_domain.
Written for commit 71e709c7829275a594f767b27468b1b52e8b5bb9.
Fix ipv6 support for http. When URL contain domain, not IP address.

backporting to 2.0: fix conflicts with the name of the main function --
_http_connection_test().
2015-10-08 11:48:02 +03:00
Azat Khuzhin
502c043a3a Fix ipv6 support for http. When URL contain domain, not IP address.
Before this patch socket created before domain was resolved, and it
always create with AF_INET (ipv4), but we must create socket only after
domain was resolved to understad which protocol family have domain
address.

Thank to Patrick Pelletier, who found this bug.
2015-10-08 11:44:49 +03:00
Mark Ellzey
571dbac81a Fix potential fd leak in listener_read_cb()
As pointed out by harlan_ in #libevent after running a coverity sweep.
If the listener is free'd, 'new_fd' is never closed.
2015-04-27 22:59:42 -04:00
Nick Mathewson
c51b159cff Update changelog release-2.0.22-stable 2015-01-05 10:17:40 -05:00
Nick Mathewson
1cd9c90596 Update changelog. 2015-01-05 09:31:12 -05:00
Nick Mathewson
489b07132f Merge branch '20_cve_2014_6272_v2' into patches-2.0 2015-01-05 09:30:02 -05:00
Nick Mathewson
079e6ddc19 Increment version to 2.0.22-stable 2015-01-05 09:18:59 -05:00
Nick Mathewson
9b855a09ef Update changelog for 2.0 2015-01-05 08:46:22 -05:00
Nick Mathewson
20d6d4458b Fix CVE-2014-6272 in Libevent 2.0
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.

Also, lower the maximum chunk size to the lower of off_t, size_t maximum.

This is necessary since otherwise we could get into an infinite loop
if we make a chunk that 'misalign' cannot index into.
2015-01-05 08:42:32 -05:00
Nick Mathewson
fb7e76aec5 Fix evbuffer_peek() with len==-1 and start_at non-NULL. 2014-12-01 08:32:05 -05:00
Nick Mathewson
1da2f42bdb Merge branch 'patches-2.0' of github.com:libevent/libevent into patches-2.0 2014-11-30 21:02:25 -05:00
Nick Mathewson
5ae5287214 Work on the changelog for 2.0.22 2014-11-30 19:38:23 -05:00
vjpai
3c7d6fcaff Fix race caused by event_active
There is a race between manual event_active and natural event activation. If both happen at the same time on the same FD, they would both be protected by the same event base lock except for 1 LoC where the fields of struct event are read without any kind of lock. This commit does those reads into local variables inside the lock and then invokes the callback with those local arguments outside the lock. In 2.0-stable, none of this is inside the lock; in HEAD, only the callback is read inside the lock. This gets the callback and all 3 arguments inside the lock before calling it outside the lock.
2014-11-30 19:24:15 -05:00
Nick Mathewson
be1aeff21a Fix a typo in a doxygen comment. Reported by 亦得. 2014-10-09 10:14:12 -04:00
ufo2243
b34e4ac3a4 [Bugfix] fix bufferevent setwatermark suspend_read 2014-09-18 15:07:41 -04:00
Maks Naumov
79800df7c7 regress_buffer: fix 'memcmp' compare size 2014-09-18 11:33:20 -04:00
Nick Mathewson
60f8f729d3 Consistently check for failure from evbuffer_pullup()
Closes issue #148.
2014-08-29 14:59:17 -04:00
Nick Mathewson
6466e88ac1 Use FindClose for handle from FindFirstFile in http-server.c
Noted by Miles Chan as issue #145
2014-08-29 14:31:07 -04:00
Pierre Phaneuf
1a8295a316 Add a few files created by "make verify" to .gitignore. 2014-08-18 10:13:52 -04:00
Nick Mathewson
e8fe749dba Fix a crash in evdns related to shutting down evdns
(Improved version to deal correctly with probe requests)

Patch from YASUOKA Masahiko; fix for libevent github issue #113.
2014-03-26 11:09:34 -04:00
Nick Mathewson
9f39c88756 Fix a crash in evdns related to shutting down evdns
Patch from YASUOKA Masahiko; fix for libevent github issue #113.
2014-03-21 14:08:17 -04:00
Trond Norbye
b56611d705 Add -Qunused-arguments for clang on macos
The clang compiler provided with macosx emits warnings like:

  CC       bufferevent.lo
clang: warning: argument unused during compilation: '-I .'
clang: warning: argument unused during compilation: '-I ./compat'
clang: warning: argument unused during compilation: '-I ./include'
clang: warning: argument unused during compilation: '-I ./include'

for each file being compiled. This generates a lot of noise during
compilation making it hard to see "real" errors. This patch mute
those warnings.
2014-03-03 11:05:41 -05:00
Nick Mathewson
f2428a284b bufferevent_pair: don't call downcast(NULL) 2014-02-09 13:29:26 -05:00
Marcin Juszkiewicz
dfe1e526f5 Check does arch have the epoll_create and __NR_epoll_wait syscalls.
Some architectures (like AArch64) do not have deprecated syscalls.

Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
2014-01-22 11:45:45 -05:00
Nick Mathewson
eaa79cd459 Merge remote-tracking branch 'sourceforge/patches-2.0' into patches-2.0
Conflicts:
	include/event2/event.h
2013-12-20 13:37:04 -05:00
Nick Mathewson
8cd695bf6d Typo fixes from Linus Nordberg 2013-12-20 13:35:03 -05:00
Nick Mathewson
cec62cb80a Typo fixes from Linus Nordberg 2013-12-20 13:31:29 -05:00
Nick Mathewson
031a803071 Clarify event_base_loop exit conditions 2013-12-16 12:02:21 -05:00
Nick Mathewson
f9284c3e3c update the 2.0 changelog 2013-12-05 17:14:05 -05:00
Nick Mathewson
3b77d62829 Avoid redundant invocations of init_extension_functions for IOCP 2013-11-01 14:20:25 -04:00
Nick Mathewson
e64a2b0b11 Fix another arc4random_buf-related warning 2013-09-19 10:48:09 -04:00
Nick Mathewson
5cb3865a40 Fix a compiler warning when checking for arc4random_buf linker breakage.
Patch by Ralph Castain.
2013-09-19 10:43:54 -04:00
Nate Rosenblum
5eb178855a Avoid racy bufferevent activation
The evhttp_send_reply method invokes evhttp_write_buffer with a
callback that may release the underlying request object and
bufferevent upon completion. This cleanup callback is invoked by the
underlying bufferevent's write callback. Improperly enabling write
events before referencing the bufferevent could lead to use after free
and memory corruption.
2013-09-09 11:59:00 -04:00
Nick Mathewson
c83efb801f Merge remote-tracking branch 'public/20_memclear' into patches-2.0 2013-08-19 10:02:55 -04:00
Nick Mathewson
f5ced88cec Really remove RNG seeds from the stack 2013-08-19 10:02:26 -04:00
Nick Mathewson
bb524712f6 Oops; revert testing code 2013-08-13 11:12:25 -04:00
Nick Mathewson
9695e9c192 Avoid other RNG initialization FS reads when urandom file is specified 2013-08-13 10:59:27 -04:00
Nick Mathewson
d44f91ad79 Finish a sentence 2013-08-13 10:59:20 -04:00
Nick Mathewson
2bbb5d7612 Add evutil_secure_rng_set_urandom_device_file
This experimental function is needed for some seccomp2 hackery to
work, and should have no effect for systems that don't use it.
2013-08-06 17:06:23 -04:00
Frank Denis
b8f59807ce libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) 2013-07-21 13:01:56 +02:00