PVS-Studio

PVS-Studio

@cody-programmer08.bsky.social

PVS-Studio | Static analyzer | C, C++, C#, and Java | Enhance the quality, security, and safety of your code! Support: support@viva64.com

43 followers41 following534 posts

🎃 Some bugs don’t show up until the lights go out. This Halloween, we’re sharing a few spooky dev stories all week👻 🕸️ The full story is in the thread.... #Halloween #DevStroies #programminghumor

View full thread

Then the developer understood. Someone had tied the logic to entity names instead of object references, and the obfuscator had quietly renamed those entities to meaningless strings. From then on, he feared server builds more than any compiler error....

🎃 Some bugs don’t show up until the lights go out. This Halloween, we’re sharing a few spooky dev stories all week👻 🕸️ The full story is in the thread.... #Halloween #DevStroies #programminghumor

Deep in the night, a developer wrote a plugin. In the dev build, everything worked flawlessly. He tested it again and again, and the code obeyed his every command. Then he downloaded the build from the server...

The plugin launched… and froze. Functions vanished; entities no longer recognized one another. Everything that had worked just yesterday crumbled to dust. In horror, the developer went back to the source code, but everything was still there.

🧵We ran PVS-Studio on the Create mod for #Minecraft (written in Java) and found a logging crash. Here's the client-server train movement package handler. The condition triggers in two cases:

View full thread

🧵We ran PVS-Studio on the Create mod for #Minecraft (written in Java) and found a logging crash. Here's the client-server train movement package handler. The condition triggers in two cases:

View full thread

The packet comes from the client, meaning it chooses the train ID. A modified client build can send requests to transfer nonexistent trains and make the server fill its log with stack traces.

The server won't crash: Create registers its packets so they execute safely, and even if an exception occurs, it gets logged, while the packet simply goes unhandled. We can fix this by including the identifier in the package:

🧵We ran PVS-Studio on the Create mod for #Minecraft (written in Java) and found a logging crash. Here's the client-server train movement package handler. The condition triggers in two cases:

1st - the train can't be found 2d - the entity is of the wrong class The second is fine: it logs a proper warning. But in the first, the code accesses 'train. id' when train is null.

Another chapter of Game++ is live on our website! Why a simpler solution that delivers slightly less performance is the better engineering decision? Sergei Kushnirenko explores this and other game engine optimization trade-offs. pvs-studio.com/en/blog/post... #gamedev #GameEngine #cpp

pvs-studio.comGame++. Part 2.2: Types of optimizationThis book offers insights into C++, including the algorithms and practices used in game development, and explores the language′s strengths and weaknesses, its established workflows, and hands-on...

𝐓𝐡𝐢𝐫𝐝-𝐩𝐚𝐫𝐭𝐲 𝐜𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭𝐬: 𝐀𝐫𝐞 𝐭𝐡𝐞𝐲 𝐰𝐨𝐫𝐭𝐡 𝐭𝐡𝐞 𝐫𝐢𝐬𝐤? Third-party libraries help speed up the development process, but every new dependency adds complexity and creates potential risks. Before you add another library, weigh its long-term consequences. #CybersecurityAwarenessMonth #Cybersecurity #DevOps

View full thread

𝐇𝐨𝐰 𝐜𝐚𝐧 𝐲𝐨𝐮 𝐫𝐞𝐝𝐮𝐜𝐞 𝐭𝐡𝐞𝐬𝐞 𝐫𝐢𝐬𝐤𝐬? Review every proposed dependency, check whether existing libraries or system APIs already provide the required features, and regularly audit your project for unused components. Security reviews should also cover third-party code. #CybersecurityAwarenessMonth

𝐓𝐡𝐢𝐫𝐝-𝐩𝐚𝐫𝐭𝐲 𝐜𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭𝐬: 𝐀𝐫𝐞 𝐭𝐡𝐞𝐲 𝐰𝐨𝐫𝐭𝐡 𝐭𝐡𝐞 𝐫𝐢𝐬𝐤? Third-party libraries help speed up the development process, but every new dependency adds complexity and creates potential risks. Before you add another library, weigh its long-term consequences. #CybersecurityAwarenessMonth #Cybersecurity #DevOps

View full thread

𝐒𝐮𝐩𝐩𝐥𝐲 𝐜𝐡𝐚𝐢𝐧 𝐚𝐭𝐭𝐚𝐜𝐤𝐬. Attackers can deliberately slip backdoors into open-source libraries. AI-generated code can also suggest nonexistent package names that malicious actors exploit using a technique known as slopsquatting. #CybersecurityAwarenessMonth #Cybersecurity #DevSecOps

𝐓𝐡𝐢𝐫𝐝-𝐩𝐚𝐫𝐭𝐲 𝐜𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭𝐬: 𝐀𝐫𝐞 𝐭𝐡𝐞𝐲 𝐰𝐨𝐫𝐭𝐡 𝐭𝐡𝐞 𝐫𝐢𝐬𝐤? Third-party libraries help speed up the development process, but every new dependency adds complexity and creates potential risks. Before you add another library, weigh its long-term consequences. #CybersecurityAwarenessMonth #Cybersecurity #DevOps

𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐯𝐮𝐥𝐧𝐞𝐫𝐚𝐛𝐢𝐥𝐢𝐭𝐢𝐞𝐬. A vulnerability in a third-party library puts your application at risk just as much as one in your own code. Transitive dependencies can turn a handful of direct dependencies into hundreds. #CybersecurityAwarenessMonth #Cybersecurity #DevSecOps

C# 15 lands in November, and unions may be the feature C# developers have waited longest. But it’s not the only change. Every October, our C# devs cover the upcoming features in our roundup: pvs-studio.com/en/blog/post... #Csharp #release #dotnet

pvs-studio.comWhat′s new in C# 15: OverviewA new version of C# is coming soon, so we′re continuing our annual tradition of reviewing its new features. The Microsoft team has prepared several highly anticipated and exciting changes for this...

Cyber Resilience Act (CRA): How SAST helps meet its requirements The EU's Cyber Resilience Act (CRA) establishes cybersecurity requirements for products with digital elements. What does the CRA require? Check the pic > #CRA #CyberResilienceAct #Cybersecurity #CybersecurityAwarenessMonth

We love writing about what we do. Sharing our dev experience is part of who we are. A milestone in PVS-Studio’s development was the launch of its JavaScript analyzer so we put together a reading list from the journey so far. Check a thread below > #JavaScript #TypeScript #NodeJS #DevExperience

View full thread

In fact, PVS-Studio had already detected this bug via another diagnostic rule, V527: It is odd that the '\0' value is assigned to 'char' type pointer. But in this post, we wanted to show how MISRA rules work + how they can help. It's also common for different detectors to catch the same error.