mirror of
https://repo.or.cz/socat.git
synced 2025-07-11 06:22:58 +00:00
fixed a stack overflow vulnerability with long command line args
This commit is contained in:
parent
07db31f7ac
commit
6340d5d2c8
3 changed files with 85 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/* source: nestlex.c */
|
||||
/* Copyright Gerhard Rieger 2006 */
|
||||
/* Copyright Gerhard Rieger 2006-2010 */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
/* a function for lexical scanning of nested character patterns */
|
||||
|
@ -211,7 +211,7 @@ int nestlex(const char **addr, /* input string; aft points to end token */
|
|||
}
|
||||
*out++ = c;
|
||||
--*len;
|
||||
if (len == 0) {
|
||||
if (*len == 0) {
|
||||
*addr = in;
|
||||
*token = out;
|
||||
return -1; /* output overflow */
|
||||
|
@ -222,7 +222,7 @@ int nestlex(const char **addr, /* input string; aft points to end token */
|
|||
/* just a simple char */
|
||||
*out++ = c;
|
||||
--*len;
|
||||
if (len == 0) {
|
||||
if (*len == 0) {
|
||||
*addr = in;
|
||||
*token = out;
|
||||
return -1; /* output overflow */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue