Commits

Ruslan Osmanov  committed c742b08

Fix: return -1 if fd is invalid

  • Participants
  • Parent commits edcbcc7

Comments (0)

Files changed (1)

 	/* Validate file descriptor */
 	if (file_desc >= 0 && fcntl(file_desc, F_GETFD) == -1) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl: invalid file descriptor passed");
+		return -1;
 	}
 
 	return file_desc;