In this book we examine a number of vulnerabilities in C-like languages that can be exploited by attackers to perform code injection attacks. Next, we discuss countermeasures that provide protection against these kinds of attacks. This book starts off by presenting a comprehensive and structured survey of vulnerabilities and countermeasures for code injection in C-like languages. Various countermeasures make different trade-offs in terms of performance, e¿ectivity, memory cost, compatibility, etc. This makes it hard to evaluate and compare the adequacy of proposed countermeasures in a given context. This survey defines a classification and evaluation framework, on the basis of which advantages and disadvantages of countermeasures can be assessed. This is followed by an in-depth discussion of two novel countermeasures which aim to better protect against attacks while having only a negligible impact on performance. The first countermeasure focuses on stack-based buffer overflows, while the second aims at heap- based buffer overflows and double frees. This book will be of interest to computer scientists and readers interested in security and operating systems.