Commit Graph

945 Commits (eedb37a65dc8ec77cb6eb871349e086aec0c3d86)

Author SHA1 Message Date
michael-grunder b731283245 Prepare for v1.0.2 GA 2021-10-07 10:00:14 -07:00
michael-grunder d4e6f109a0 Revert erroneous SONAME bump 2021-10-07 09:48:08 -07:00
michael-grunder a39824a5df Merge branch 'release/v1.0.1'
Merge the v1.0.1 release branch and bump the dev version to 1.0.2-dev
2021-10-04 13:35:10 -07:00
michael-grunder 8d1bfac464 Prepare for v1.0.1 GA 2021-10-04 13:08:51 -07:00
Yossi Gottlieb 76a7b10005 Fix for integer/buffer overflow CVE-2021-32765
This fix prevents hiredis from trying to allocate more than `SIZE_MAX`
bytes, which would result in a buffer overrun.

[Full Details](https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2)
2021-10-04 11:56:31 -07:00
Yunier Perez 9eca1f36f4 Allow to override OPENSSL_PREFIX in Linux 2021-10-03 10:58:27 -07:00
rouzier 2d9d77518d
Don't leak memory if an invalid type is set (#906)
Co-authored-by: James Rouzier <jrouzier@inverse.ca>
2021-08-18 19:13:34 -07:00
Meir Shpilraien (Spielrein) f5f31ff9b9
Added REDIS_NO_AUTO_FREE_REPLIES flag (#962)
When set hiredis will not automatically free replies in an async context, and the replies must be freed instead by the user.

Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
2021-07-11 11:26:20 -07:00
michael-grunder 5850a8ecd2 Ensure we curry any connect error to an async context. 2021-06-17 13:37:49 -07:00
michael-grunder b6f86f38c2 Fix README.md
Closes #929
2021-05-23 10:45:47 -07:00
Michael Grunder 667dbf5365
Merge pull request #935 from kristjanvalur/pr5
Bugfix: Ignore timeout callback from a successful connect (fixes #945)
2021-05-02 12:26:05 -07:00
Michael Grunder 9bf6c250e5
Merge pull request #939 from zmartzone/improve_pr_896_ssl_leak
improve SSL leak fix redis/hiredis#896
2021-05-02 11:49:48 -07:00
Michael Grunder 959af97609
Merge pull request #949 from plan-do-break-fix/Typo-corrections
fix(docs): corrects typos in project README
2021-05-02 11:29:52 -07:00
plan-do-break-fix 0743f57bba fix(docs): corrects typos in project README 2021-04-24 02:23:36 -05:00
Hans Zandbelt 5f4382247a improve SSL leak fix redis/hiredis#896
Free SSL object when redisSSLConnect fails but avoid doing that for
callers of redisInitiateSSL who are supposed to manager their own SSL
object.

Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
2021-04-11 18:49:38 +02:00
Kristján Valur Jónsson e06ecf7e45 Ignore timeout callback from a successful connect 2021-04-08 09:45:49 +00:00
michael-grunder dfa33e60b0 Change order independant push logic to not change behavior.
Since redisGetReplyFromReader is exposed in a header file, we probably
shouldn't modify how it behaves in any way.  For this reason, handle the
changed logic in an internal static helper method.
2021-04-02 09:34:09 -07:00
michael-grunder 6204182aae Handle the case where an invalidation is sent second.
RESP3 invalidation messages always seemed to be sent before the response
to a given command, but it appears this is not always the case:

In Redis 6.2.0RC1 Redis sends the invalidation after the HSET in the
following sequence:

```
hget hash field
$5
value
hset hash field value
:0
>2
$10
invalidate
*1
$4
hash
```

To account for this possibility just wrap redisGetReplyFromReader in a
loop as it is called twice in redisGetReply.
2021-04-02 09:34:09 -07:00
michael-grunder d6a0b192b4 Merge branch 'reader-updates'
Updates and improvements to the RESP3 protocol reader.

* Fix the unset len field when creating RESP3 double objects
* Fix RESP3 double infinity parsing
* Add additional validations when parsing various reply types
* Fix the parent type assertions in certain default reply object
  creation callbacks (mostly to include PUSH as a parent).
* Additional reader test cases
* Implement RESP3 BIGNUM support
* Refactor seekNewline() to use memchr()
2021-02-25 21:53:34 -08:00
michael-grunder 410c24d2a9 Fix off-by-one error in seekNewline 2021-02-25 21:25:17 -08:00
Alex Smith bd7488d27d read: Validate line items prior to checking for object creation callbacks 2021-02-25 21:25:17 -08:00
Alex Smith 5f9242a1f8 read: Remove obsolete comment on nested multi bulk depth limitation 2021-02-25 21:25:17 -08:00
Alex Smith 83c1450425 read: Add support for the RESP3 bignum type 2021-02-25 21:25:17 -08:00
Alex Smith c6646cb192 read: Ensure no invalid '\r' or '\n' in simple status/error strings 2021-02-25 21:25:17 -08:00
Alex Smith e43061156c read: Additional validation and test case for RESP3 double
This ensures that malformed RESP3 double messages that include an
invalid null byte are not parsed as valid.
2021-02-25 21:25:17 -08:00
Alex Smith c8adea4024 redisReply: Fix parent type assertions during double, nil, bool creation
Per RESP3, push messages are able to contain exactly what array
messages can contain (that is, any other type).
2021-02-25 21:25:17 -08:00
Alex Smith ff73f1f9e7 redisReply: Explicitly list nil and bool cases in freeReplyObject() switch. 2021-02-25 21:25:17 -08:00
Alex Smith 0f92518847 test: Add test case for RESP3 set 2021-02-25 21:25:17 -08:00
Alex Smith 33c06dd503 test: Add test case for RESP3 map 2021-02-25 21:25:17 -08:00
Alex Smith 397fe26301 read: Use memchr() in seekNewline() instead of looping over entire string 2021-02-25 21:25:17 -08:00
Alex Smith 81c48a9821 test: Add test cases for RESP3 bool 2021-02-25 21:25:17 -08:00
Alex Smith 51e693f4fd read: Add additional RESP3 bool validation
RESP3 bools should be only one of "#t\r\n" or "#f\r\n". We also allow
capital 'T' and 'F' to be lenient.
2021-02-25 21:25:17 -08:00
Alex Smith 790b4d3b4d test: Add test cases for RESP3 nil 2021-02-25 21:25:17 -08:00
Alex Smith d8899fbc19 read: Add additional RESP3 nil validation
RESP3 nil should consist of "_\r\n" and nothing else.
2021-02-25 21:25:17 -08:00
Alex Smith 96e8ea6110 test: Add test cases for infinite and NaN doubles 2021-02-25 21:25:17 -08:00
Alex Smith f913e9b997 read: Fix double validation and infinity parsing
The ',' protocol byte gets removed in processItem(), so it should not
be compared against in processLineItem().

strtod() allows multiple representations of infinity and NaN that are
not RESP3 compliant. Since we explicitly check for the two compliant
infinity cases, strtod() should only return finite values.
2021-02-25 21:25:17 -08:00
Alex Smith 8039c7d26c test: Add test case for doubles 2021-02-25 21:25:17 -08:00
Alex Smith 49539fd1a7 redisReply: Fix - set len in double objects 2021-02-25 21:25:17 -08:00
Michael Grunder 53a8144c81
Merge pull request #924 from cheese1/master
http -> https
2021-02-17 10:08:35 -08:00
cheese1 9390de006d
http -> https 2021-02-17 16:15:45 +01:00
Michael Grunder 7d99b56356
Merge pull request #917 from Nordix/stack-alloc-dict-iter
Stack allocate dict iterators
2021-01-26 11:20:25 -08:00
Bjorn Svensson 4bba72103c Handle OOM during async command callback registration
Unless the callback is pushed to the list it will trigger an assert
in redisProcessCallbacks() when the response arrives.
This change let the user get an early error instead,
available in the async context directly.
2021-01-26 09:57:19 +01:00
Bjorn Svensson 920128a260 Stack allocate dict iterators
Replacing the get & release functions with an initiation
function. Simplifies the code and will make sure we
run subscription callbacks in OOM scenarios.
2021-01-25 16:19:42 +01:00
michael-grunder 297ecbecb7 Tiny formatting changes + suppress implicit memcpy warning 2020-12-12 11:56:35 -08:00
AdamKorcz f746a28e71 Removed 2 typecasts 2020-12-12 19:26:04 +00:00
AdamKorcz 940a04f4dd Added fuzzer 2020-12-11 14:03:42 +00:00
Michael Grunder e4a200040a
Merge pull request #896 from ayeganov/bugfix/ssl_leak
Free SSL object when redisSSLConnect fails
2020-11-15 09:56:10 -08:00
Aleksandr Yeganov aefef8987f Free SSL object when redisSSLConnect fails 2020-11-10 11:59:41 -05:00
Michael Grunder e3f88ebcf8
Merge pull request #894 from jcohen02/fix/issue893
Updating SSL connection example in README
2020-10-27 14:20:53 -07:00
Jeremy Cohen 308ffcab8d Updating SSL connection example 2020-10-27 19:40:13 +00:00