Checked-size Array Parameters in C: Addressing Safety Issues with Array Size Validation
By
chmaynard
Hand-rolled, kettle-boiled, baked to perfection. Worth every minute at the bakery.
Summary
The article discusses a recent attempt to add safety checks for array parameters in the C programming language, specifically within the crypto layer. It explains how C's minimal checks fail to catch programmer mistakes like passing arrays of wrong sizes to functions, and explores technical approaches to address this issue through checked-size array parameters.
Key quotes
· 3 pulledThere are many possible programmer mistakes that are not caught by the minimal checks specified by the C language; among those is passing an array of the wrong size to a function.
A recent attempt to add some safety around array parameters within the crypto layer
Our strength is writing the kind of articles that developers, administrators, and free-software supporters depend on to know what is going on in the Linux world.
You might also wanna read
Cscript Style Guide: A Python-Inspired Approach to C Programming
Cscript is presented as a style guide for writing C code that aims to make C development faster and more Python-like while maintaining C's p
Pigeon's Device: An Independent Loop Optimization Technique in C Programming
The article introduces Pigeon's device, a loop optimization technique in C programming that was independently developed from Duff's device.
Implementing Closures in C Using JIT-Compiled Wrappers for Win32 Window Procedures
The article discusses an advanced programming technique for creating closures in C using JIT-compiled wrappers, specifically applied to Win3
Guidelines for Writing Fully Encapsulated C Programs: Pure vs Performance Approaches
This article presents a comprehensive set of rules and guidelines for writing fully encapsulated C programs, developed by the author over ye
Creating a Leak-Free, Thread-Safe Grep Utility in C23 with Safe Programming Practices
The article details the author's experience creating a leak-free, thread-safe grep utility in C23 using a custom header file called safe_c.h
Implementing Generic Programming in C: Techniques and Trade-offs
The article explains how to implement generic programming in C despite the language not having built-in generics support. It covers various
