[libc-commits] [libc] [libc] Add a differential fuzzer for inet_aton (PR #200341)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Tue Jun 2 02:00:54 PDT 2026


================
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Differential fuzz test for llvm-libc inet_aton implementation.
+///
+//===----------------------------------------------------------------------===//
+
+#include "src/arpa/inet/inet_aton.h"
+#include <arpa/inet.h>
----------------
kaladron wrote:

Oh, right.  I'm kinda shocked that this works at all and this feels like something that is doomed to fail at some point with mixing and matching.  

I haven't learned our fuzzing infra yet, but this feels like something that for robustness should compile against external headers twice: Once against the comparator and once against ours, and have a controller that sends each the fuzzing to do.  Or I wonder if there are some linker tricks we can use to wrap the object files before they're combined into one binary?

(This is all just thinking out loud)

https://github.com/llvm/llvm-project/pull/200341


More information about the libc-commits mailing list