Top "Secure-coding" questions

Topics related to coding patterns and best practices for avoiding common bugs and security holes.

Which of sprintf/snprintf is more secure?

I wish to know which of these two options is the more secure one to use: #define MAXLEN 255 char buff[…

c security unix printf secure-coding
How to secure database configuration file in project?

I have created on php file for establishing connection with database server. In this file, i am using mysql_connect() …

php mysql secure-coding
how to redirect page to https in php?

i have a login form: <form method =POST action="/login.php"> ... </form> i would like the …

php redirect https secure-coding
What is vulnerable about this C code?

#include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h&…

c linux security exploit secure-coding
how does one securely clear std::string?

How does one store sensitive data (ex: passwords) in std::string? I have an application which prompts the user for …

c++ string passwords secure-coding
Secure Coding Guidelines for Python

Looking at the CERT Secure Standards (Example: https://www.securecoding.cert.org), there are specific standards, with great examples of …

python security secure-coding
PHP Secure Session Login - Best Practice

As part of my web app. This is some code I am considering (I'm not the best of PHP programmers …

php session secure-coding
Checkmarx Java fix for Log Forging -sanitizing user input

Can anyone suggest the proper sanitization/validation process required for the courseType variable in the following getCourses method. I am …

java spring-boot spring-mvc checkmarx secure-coding
Filtering upwards path traversal in Java (or Scala)

Are there any standard library methods that can filter out paths which include special traversal sequences, such as ../ and all …

java owasp secure-coding path-traversal
Secure C++ coding practices

I am looking for a comprehensive record of secure coding practices in C++. Since i haven't found such a list …

c++ security secure-coding