@@ -576,7 +576,7 @@ static void php_memc_get_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key)
576
576
MEMC_METHOD_FETCH_OBJECT ;
577
577
i_obj -> rescode = MEMCACHED_SUCCESS ;
578
578
579
- if (key_len == 0 || strchr (key , ' ' )) {
579
+ if (key_len == 0 || key_len > 250 || strchr (key , ' ' ) || strchr ( key , '\n ' )) {
580
580
i_obj -> rescode = MEMCACHED_BAD_KEY_PROVIDED ;
581
581
RETURN_FROM_GET ;
582
582
}
@@ -1448,7 +1448,7 @@ static void php_memc_store_impl(INTERNAL_FUNCTION_PARAMETERS, int op, zend_bool
1448
1448
MEMC_METHOD_FETCH_OBJECT ;
1449
1449
i_obj -> rescode = MEMCACHED_SUCCESS ;
1450
1450
1451
- if (key_len == 0 || strchr (key , ' ' )) {
1451
+ if (key_len == 0 || key_len > 250 || strchr (key , ' ' ) || strchr ( key , '\n ' )) {
1452
1452
i_obj -> rescode = MEMCACHED_BAD_KEY_PROVIDED ;
1453
1453
RETURN_FALSE ;
1454
1454
}
@@ -1599,7 +1599,7 @@ static void php_memc_cas_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key)
1599
1599
MEMC_METHOD_FETCH_OBJECT ;
1600
1600
i_obj -> rescode = MEMCACHED_SUCCESS ;
1601
1601
1602
- if (key_len == 0 || strchr (key , ' ' )) {
1602
+ if (key_len == 0 || key_len > 250 || strchr (key , ' ' ) || strchr ( key , '\n ' )) {
1603
1603
i_obj -> rescode = MEMCACHED_BAD_KEY_PROVIDED ;
1604
1604
RETURN_FALSE ;
1605
1605
}
@@ -1717,7 +1717,7 @@ static void php_memc_delete_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key)
1717
1717
MEMC_METHOD_FETCH_OBJECT ;
1718
1718
i_obj -> rescode = MEMCACHED_SUCCESS ;
1719
1719
1720
- if (key_len == 0 || strchr (key , ' ' )) {
1720
+ if (key_len == 0 || key_len > 250 || strchr (key , ' ' ) || strchr ( key , '\n ' )) {
1721
1721
i_obj -> rescode = MEMCACHED_BAD_KEY_PROVIDED ;
1722
1722
RETURN_FALSE ;
1723
1723
}
@@ -1817,7 +1817,7 @@ static void php_memc_incdec_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key,
1817
1817
MEMC_METHOD_FETCH_OBJECT ;
1818
1818
i_obj -> rescode = MEMCACHED_SUCCESS ;
1819
1819
1820
- if (key_len == 0 || strchr (key , ' ' )) {
1820
+ if (key_len == 0 || key_len > 250 || strchr (key , ' ' ) || strchr ( key , '\n ' )) {
1821
1821
i_obj -> rescode = MEMCACHED_BAD_KEY_PROVIDED ;
1822
1822
RETURN_FALSE ;
1823
1823
}
0 commit comments