CSE elimination, fix #6218
This commit is contained in:
parent
7666542ab6
commit
8b99abbe62
@ -84,8 +84,12 @@ static void
|
|||||||
buffer_write_urlencode (struct GNUNET_Buffer *buf,
|
buffer_write_urlencode (struct GNUNET_Buffer *buf,
|
||||||
const char *s)
|
const char *s)
|
||||||
{
|
{
|
||||||
|
size_t ulen;
|
||||||
|
|
||||||
|
ulen = urlencode_len (s);
|
||||||
|
GNUNET_assert (ulen < ulen + 1);
|
||||||
GNUNET_buffer_ensure_remaining (buf,
|
GNUNET_buffer_ensure_remaining (buf,
|
||||||
urlencode_len (s) + 1);
|
ulen + 1);
|
||||||
for (size_t i = 0; i < strlen (s); i++)
|
for (size_t i = 0; i < strlen (s); i++)
|
||||||
{
|
{
|
||||||
if (GNUNET_YES == is_reserved (s[i]))
|
if (GNUNET_YES == is_reserved (s[i]))
|
||||||
@ -139,6 +143,8 @@ calculate_argument_length (va_list args)
|
|||||||
{
|
{
|
||||||
char *key;
|
char *key;
|
||||||
char *value;
|
char *value;
|
||||||
|
size_t vlen;
|
||||||
|
size_t klen;
|
||||||
|
|
||||||
key = va_arg (ap,
|
key = va_arg (ap,
|
||||||
char *);
|
char *);
|
||||||
@ -148,10 +154,12 @@ calculate_argument_length (va_list args)
|
|||||||
char *);
|
char *);
|
||||||
if (NULL == value)
|
if (NULL == value)
|
||||||
continue;
|
continue;
|
||||||
GNUNET_assert ( (len <= len + urlencode_len (value)) &&
|
vlen = urlencode_len (value);
|
||||||
(len <= len + urlencode_len (value) + strlen (key)) &&
|
klen = strlen (key);
|
||||||
(len < len + urlencode_len (value) + strlen (key) + 2) );
|
GNUNET_assert ( (len <= len + vlen) &&
|
||||||
len += urlencode_len (value) + strlen (key) + 2;
|
(len <= len + vlen + klen) &&
|
||||||
|
(len < len + vlen + klen + 2) );
|
||||||
|
len += vlen + klen + 2;
|
||||||
}
|
}
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
return len;
|
return len;
|
||||||
|
Loading…
Reference in New Issue
Block a user