Added a validation that constraints have an upper bound

This will prevent issues like the one fixed in https://github.com/sensiolabs/security-advisories/commit/11c28665e17bc3cdb572733963e4dca1431375db