Detection of Code Vulnerabilities via Constraint-Based Analysis and Model Checking