mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 18:12:10 +03:00
fix out-of-bounds read in sslh-ev (fix #368)
This commit is contained in:
1 parent
00fc8e5d95
commit
1f64a71cde
1 file changed
+5
@@ -32,6 +32,11 @@ static inline int __attribute__((unused)) gap_set(gap_array* gap, int index, voi
|
|||||||
|
|
||||||
static inline void* __attribute__((unused)) gap_get(gap_array* gap, int index)
|
static inline void* __attribute__((unused)) gap_get(gap_array* gap, int index)
|
||||||
{
|
{
|
||||||
|
/* sslh-ev routinely reads before it writes. It's not clear if it should be
|
||||||
|
* its job to check the length (and add a gap_getlen()), or if it should be
|
||||||
|
* gap_get()'s job. This will do for now */
|
||||||
|
if (index >= gap->len) return NULL;
|
||||||
|
|
||||||
return gap->array[index];
|
return gap->array[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user