Software security is concerned with methods of producing secure software. Concepts that are important to software security contain system risks management, programming language, platform, software audits, designing security and security tests. In other words, compliance with the security provisions in the production process can be considered an issue of passive defense in the field of software. In most cases, the programming mistakes that are easily avoided, lead to exploitable vulnerabilities in software. Reviews and analyses performed on thousand reported vulnerabilities, suggest that most vulnerabilities arise from a small number of common programming errors. We know that as soon as a vulnerability is discovered, it is easier and cheaper to fix. Application of the safe software development lifecycle, which investigates the security in each step of development to identify early potential vulnerabilities in each stage of development for the early identification of potential vulnerabilities is of utmost importance in securing software.Therefore, developers should understand secure coding techniques in order to reduce security errors and appropriate development of secure applications. This article suggests guidelines for secure coding.