Fixing Code Errors in Amnesia: The Dark Descent

Just before the release of the "Amnesia: Rebirth" game, the vendor "Fractional Games" opened the source code of the legendary "Amnesia: The Dark Descent" and its sequel "Amnesia: A Machine For Pigs". Why not use the static analysis tool to see what dreadful mistakes are hidden in the inside of these cult horror games?

Lay a strong foundation by writing secure C and C++ utilities

Libraries and system utilities form the foundations on which larger projects are built. So it's critical to make sure they, in particular, are secure. That's why we recently introduced five new rules for C++ and C to detect broken authentication and access control in *nix systems. The new rules fall into three categories: account validity, granting permissions, and changing directories. 

For secure code, maintainability matters

Author Robert Collier said that "Success is the sum of small efforts repeated day in and day out." That's especially true when it comes to security. Poor maintainability contributed to Heartbleed. To make the case for how maintainable code contributes to security, I'll start with the Heartbleed ...

Checking a Header-Only C++ Library Collection (awesome-hpp)

Somehow, we've happened to check most of the libraries making up a collection called "Awesome hpp". These are small header-only projects in C++. Hopefully, the information about the bugs we've found will help make the libraries better. We'll also be happy to see the developers use PVS-Studio on a regular basis thanks to the free-license option we provide.

Top 10 C++ Open Source Project Bugs Found in 2019

Another year is drawing to an end, and it's a perfect time to make yourself a cup of coffee and reread the reviews of bugs collected across open-source projects over this year. This would take quite a while, of course, so we prepared this article to make it easier for you. Today we'll be recalling the most interesting dark spots that we came across in open-source C/C++ projects in 2019.

Machine Learning in Static Code Analysis

Machine learning has firmly entrenched in a variety of human fields, from speech recognition to medical diagnosing. The popularity of this approach is so great that people try to use it wherever they can.

False positives Are Considered Enemies, But Can They Be Your Friends?

In this post, I’ll discuss how the different types of rules give rise to different types of false positives, which ones are easier to fix than others, and how you can help. I’ll end with insight into how issues that are false positives can still be true indicators that the code needs to change.

Chain of Responsibility Design Pattern in Modern C++

Chain of Responsibility is a Behavioural Design Pattern that provides facility to propagate event/request/command/query to the chain of loosely coupled objects. Chain of Responsibility Design Pattern in Modern C++ lets you pass requests along a chain of handlers & upon receiving a request, each handler decides either to process the request or to forward it to the next handler in the chain.

Learning C++: Inheritance

In this article I’m going to introduce how to perform object inheritance in C++. When we use inheritance in our C++ programs, we are modeling is-a relationships. For example, a dog is-a mammal; a Volkswagen Beetle is-a car; a square is-a shape.

Bugs from the 90's: The Code of Command and Conquer

The American company Electronic Arts Inc (EA) has opened the source code of the games Command & Conquer: Tiberian Dawn and Command & Conquer: Red Alert publicly available. Several dozen errors were detected in the source code using the PVS-Studio analyzer, so, please, welcome the continuation of found defects review.

Bugs From the 90's: The Code of the Command & Conquer Game

In this post, I’ll discuss how the different types of rules give rise to different types of false positives, which ones are easier to fix than others, and how you can help. I’ll end with insight into how issues that are false positives can still be true indicators that the code needs to change.

Proxy Design Pattern in Modern C++

In this article of the Structural Design Patterns, we’re going to take a look at Proxy Design Pattern in C++ which dictates the way you access the object.

How To Win The Race Against TOCTOU Vulnerabilities in C & C++

Security is an eternal race between the techniques and technologies of attackers and those of the defenders. Today, I'm proud to announce a step forward for defenders with a new rule to detect a literal race condition: TOCTOU (or TOCTTOU) vulnerabilities, known in long-form as Time Of Check (to) Time Of Use. 

Learning C++: Overloading the Assignment, Increment, and Decrement Operators

Learning C++: Overloading the Assignment, Increment, and Decrement Operators. In this article, I will cover how to overload three more operators: assignment, increment, and decrement.

How To Get Accurate Feedback From The SonarQube Ecosystem Into C++ Directly

In this post, I'll walk through how SonarQube and SonarLint integrate smoothly into your workflow and your team to give you the right data at the right time and in the right place.

Flyweight Design Pattern in Modern C++

This article has been originally published on my blog. If you are interested in receiving my latest articles, please sign up to my newsletter.

Bridge Design Pattern in Modern C++

Bridge Design Pattern is a Structural Design Pattern used to decouple a class into two parts so that both can be developed independently.

Facade Design Pattern in Modern C++

Facade Design Pattern is a Structural Design Pattern used to provide a unified interface to a complex system. It is same as Facade in building architecture, a Facade is an object that serves as a front-facing interface masking a more complex underlying system.

Decorator Design Pattern in Modern C++

In software engineering, Structural Design Patterns deal with the relationship between object & classes i.e. how object & classes interact or build a relationship in a manner suitable to the situation.

Surface area calculator using OpenCV

In this OpenCV C++ tutorial article, we will learn how to calculate approximately the surface area of a random shape using various aspects of Computer Vision with OpenCV.