<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Templates on guy@secdev.uk</title>
    <link>https://www.secdev.uk/blog/tags/templates/</link>
    <description>Recent content in Templates on guy@secdev.uk</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <copyright>Guy Dixon | guy@secdev.uk</copyright>
    <lastBuildDate>Sat, 08 Nov 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.secdev.uk/blog/tags/templates/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>C&#43;&#43; Security: Smart Pointers Aren&#39;t Always Smart Enough</title>
      <link>https://www.secdev.uk/blog/technology/2025-11-08-cpp-security-smart-pointers/</link>
      <pubDate>Sat, 08 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.secdev.uk/blog/technology/2025-11-08-cpp-security-smart-pointers/</guid>
      <description>&lt;p&gt;The more I dug into C++ codebases, the more I noticed a recurring assumption: developers who think that switching to smart pointers and STL containers means they&amp;rsquo;re safe from memory bugs. C++ adds RAII, smart pointers, containers, and type-safe abstractions on top of C&amp;rsquo;s manual memory model, and these features genuinely eliminate many of C&amp;rsquo;s most common vulnerabilities, &lt;code&gt;std::string&lt;/code&gt; prevents buffer overflows, &lt;code&gt;std::unique_ptr&lt;/code&gt; prevents memory leaks, and &lt;code&gt;std::vector&lt;/code&gt; provides bounds-checked access via &lt;code&gt;.at()&lt;/code&gt;. But C++ also introduces new attack surfaces that turn out to be even trickier to spot: dangling references from moved-from objects, iterator invalidation, implicit conversions in template code, and the false sense of security that comes from using &amp;ldquo;safe&amp;rdquo; abstractions incorrectly. In this post, I want to cover the C++-specific anti-patterns that survive code review because they look correct to developers who trust the standard library.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
