# Memory safety verification

A software-engineering practice that uses tools to detect memory-safety bugs in native code.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## A "proof" of Fermat's Last Theorem that fits the margin

DevFeed: [A "proof" of Fermat's Last Theorem that fits the margin](<https://devfeed.tech/articles/a-proof-of-fermat-s-last-theorem-that-fits-the-margin-7665.md>)

Original publisher: [Read original article](<https://blog.trailofbits.com/2026/09/09/a-proof-of-fermats-last-theorem-that-fits-the-margin/>)

Author: "Marc Ilunga"

Published: 2026-09-09T11:00:00Z

Content type: article

Language: en

Sources: [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog.md>), [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog-2.md>)

Topics: [Lean](<https://devfeed.tech/topics/lean.md>), [bug](<https://devfeed.tech/topics/bug.md>), [Memory safety verification](<https://devfeed.tech/topics/memory-safety-verification.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [exploits](<https://devfeed.tech/tags/exploits.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [vulnerability-disclosure](<https://devfeed.tech/tags/vulnerability-disclosure.md>)

### AI overview

A Lean string-slicing bug caused its logical evaluator and compiled native code to disagree, allowing a contradiction that could make an invalid proof appear checked. The issue was fixed after disclosure.

### Source excerpt

Fermat famously claimed to have a "truly marvelous proof" of his Last Theorem, but he never wrote it down, insisting the margin of his page was too narrow to contain it. A few centuries later, Anthropic announced a complete formalization of Fermat's Last Theorem using 13 million lines of Lean code (clearly not what Fermat intended). Luckily, we found a wonderfully cursed Lean bug, shown below, that suggests the proof may have fit the margin after all. The issue affects all stable versions of Lean up to 4.33.1, and the patch is incorporated in v4.34.0-rc1. A "checked" proof of Fermat's Last Theorem using Lean 4.33.1 The blue checkmarks in the screenshot above would suggest that Lean considers this proof correct. This seems odd given the amount of work Sir Andrew Wiles put into this problem and the vast size of Claude's proof. So what is going on? The "proof" clearly doesn't make any sense and exploits an issue in Lean. We found the issue while using GPT-5.6 to experiment with a new skill for code review. We want to clarify up front that the issue is not a kernel soundness issue, but it happens to nicely fit any discussion of strings, lengths, and substrings. The issue affects String.Pos.Raw.extract, Lean's low-level string-slicing function. When asked to extract a one-byte slice at an astronomically large position, Lean's logical definition returns the empty string. But the compiled native code returns the entire original string. That disagreement is enough to manufacture a contradiction. Lean's ordinary evaluator "proves" that the tiny slice was empty, while native evaluation "proves" that the very same slice contained "a truly marvelous proof." Put those together, and Lean concludes that the empty string equals a non-empty string. And once you have a contradiction, you can prove anything, including Fermat's Last Theorem. On the bright side, the Lean team was considerably faster than mathematical history. About 90 minutes after we reported the issue, hargoniX opened

## Swift at Apple: Migrating the TrueType Hinting Interpreter

DevFeed: [Swift at Apple: Migrating the TrueType Hinting Interpreter](<https://devfeed.tech/articles/swift-at-apple-migrating-the-truetype-hinting-interpreter-2932.md>)

Original publisher: [Read original article](<https://swift.org/blog/migrating-truetype-hinting-to-swift/>)

Author: Scott Perry

Published: 2026-06-12T10:00:00Z

Content type: article

Language: en

Sources: [Swift.org](<https://devfeed.tech/sources/swift-org.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Font](<https://devfeed.tech/topics/font.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [Security](<https://devfeed.tech/topics/security.md>), [Memory safety verification](<https://devfeed.tech/topics/memory-safety-verification.md>), [Web](<https://devfeed.tech/topics/web.md>), [pdf](<https://devfeed.tech/topics/pdf.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [applications](<https://devfeed.tech/tags/applications.md>), [code](<https://devfeed.tech/tags/code.md>), [fonts](<https://devfeed.tech/tags/fonts.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [performance](<https://devfeed.tech/tags/performance.md>), [security](<https://devfeed.tech/tags/security.md>), [swift](<https://devfeed.tech/tags/swift.md>), [web](<https://devfeed.tech/tags/web.md>)

### AI overview

Apple describes rewriting its TrueType hinting interpreter from C to memory-safe Swift for Fall 2025 releases. The rewrite addresses the security risks of processing untrusted fonts and reportedly improves performance by 13% on average.

### Source excerpt

TrueType is a widely used vector font standard for rendering text in web pages, PDFs, operating systems, and applications. Familiar fonts like Helvetica, Garamond, and Monaco are all built on TrueType outlines. The format specifies a hinting interpreter intended to help outlines rasterize faithfully on low-resolution displays. Modern high-resolution displays enable beautiful typography from outlines alone, but TrueType fonts that need hinting to render legibly remain in use and we continue to support them. Font parsers process data from untrusted sources, making the TrueType hinting interpreter a security-critical attack surface. To make the format more resilient on Apple platforms, we rewrote its hinting interpreter from C to memory-safe Swift for the Fall 2025 releases. In addition to memory safety, we also improved performance: on average, our Swift interpreter runs 13% faster than the C interpreter it replaced. To accompany this post, we've also published the source code of the Swift TrueType hinting interpreter. We hope sharing our experience helps others doing similar work in Swift. TrueType and the hinting engine Apple developed TrueType in the late 1980s and released it with the launch of System 7 in 1991. TrueType was a major breakthrough for the time: it gave font developers enormous control over how glyphs are displayed, with an advanced grid-fitting algorithm and a sophisticated hinting engine built around a special-purpose bytecode interpreter. TrueType did all this on computers that were vastly less powerful than today's, so it had to be extremely well-tuned for performance. Then the internet revolutionized how fonts were used. TrueType became embeddable in PDF files in 1994 and in web pages in 2008, and it remains as relevant as ever. However, these new use cases brought additional risk: TrueType could now be exposed to untrusted fonts from anywhere on the internet. TrueType fonts may contain programs the hinting engine runs through a bytecode interpr

## Zed Weekly: #29

DevFeed: [Zed Weekly: #29](<https://devfeed.tech/articles/zed-weekly-29-13598.md>)

Original publisher: [Read original article](<https://zed.dev/blog/zed-weekly-29>)

Author: Joseph Lyons

Published: 2023-12-15T00:00:00Z

Content type: article

Language: en

Sources: [Zed Industries - Blog](<https://devfeed.tech/sources/zed-industries-blog.md>)

Topics: [Framework](<https://devfeed.tech/topics/framework.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [code productivity](<https://devfeed.tech/topics/code-productivity.md>), [Memory safety verification](<https://devfeed.tech/topics/memory-safety-verification.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [framework](<https://devfeed.tech/tags/framework.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [performance](<https://devfeed.tech/tags/performance.md>), [progress-report](<https://devfeed.tech/tags/progress-report.md>), [updates](<https://devfeed.tech/tags/updates.md>)

### AI overview

Zed Weekly #29 reports on performance work for GPUI 2, including benchmarking tab-switching responsiveness and implementing a thread-local bump-allocated arena to reduce rendering allocation costs. It also mentions theme importer updates and a visual progress report for Zed2.

### Source excerpt

Performance improvements to GPUI 2, updates on the theme importer, and a visual progress report of Zed2