convert_to_long_ex(arg2);
len = (*arg2)->value.lval;
+ if (len < 0) {
+ php_error(E_WARNING, "length parameter to fgets() may not be negative");
+ RETURN_FALSE;
+ }
if (type == le_socket) {
issock=1;
convert_to_long_ex(bytes);
len = (*bytes)->value.lval;
+ if (len < 0) {
+ php_error(E_WARNING, "length parameter to fgetss() may not be negative");
+ RETURN_FALSE;
+ }
buf = emalloc(sizeof(char) * (len + 1));
/*needed because recv doesnt set null char at end*/
convert_to_long_ex(arg2);
len = (*arg2)->value.lval;
+ if (len < 0) {
+ php_error(E_WARNING, "length parameter to fread() may not be negative");
+ RETURN_FALSE;
+ }
return_value->value.str.val = emalloc(sizeof(char) * (len + 1));
/* needed because recv doesnt put a null at the end*/
convert_to_long_ex(bytes);
len = (*bytes)->value.lval;
+ if (len < 0) {
+ php_error(E_WARNING, "length parameter to fgetcsv() may not be negative");
+ RETURN_FALSE;
+ }
buf = emalloc(sizeof(char) * (len + 1));
/*needed because recv doesnt set null char at end*/