Skip to content
Snippets Groups Projects
Commit ff88670e authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

decode_value() now checks that the string it's supposed to decode isn't wide.

Rev: src/encode.c:1.39
parent 48bd9cd7
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "stuff.h" #include "stuff.h"
#include "version.h" #include "version.h"
RCSID("$Id: encode.c,v 1.38 1999/09/21 21:16:26 hubbe Exp $"); RCSID("$Id: encode.c,v 1.39 1999/09/22 19:01:27 grubba Exp $");
#ifdef _AIX #ifdef _AIX
#include <net/nh.h> #include <net/nh.h>
...@@ -1265,6 +1265,7 @@ static INT32 my_decode(struct pike_string *tmp, ...@@ -1265,6 +1265,7 @@ static INT32 my_decode(struct pike_string *tmp,
data->codec=codec; data->codec=codec;
data->pickyness=0; data->pickyness=0;
if (tmp->size_shift) return 0;
if(data->len < 5) return 0; if(data->len < 5) return 0;
if(GETC() != 182 || if(GETC() != 182 ||
GETC() != 'k' || GETC() != 'k' ||
...@@ -1389,7 +1390,8 @@ void f_decode_value(INT32 args) ...@@ -1389,7 +1390,8 @@ void f_decode_value(INT32 args)
struct pike_string *s; struct pike_string *s;
struct object *codec; struct object *codec;
check_all_args("decode_value",args, BIT_STRING, BIT_VOID | BIT_OBJECT | BIT_INT, 0); check_all_args("decode_value", args,
BIT_STRING, BIT_VOID | BIT_OBJECT | BIT_INT, 0);
s = sp[-args].u.string; s = sp[-args].u.string;
if(args<2) if(args<2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment