From 59a2c31459d0c3459dbcdbc669adc5db1d4ae864 Mon Sep 17 00:00:00 2001 From: Benjamin Demaille Date: Tue, 7 Jul 2026 05:23:01 +0200 Subject: [PATCH 1/2] kssd 2.21 Co-authored-by: Claude Opus 4.8 (1M context) --- Formula/kssd.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/kssd.rb b/Formula/kssd.rb index ce23d7616..8e32a103d 100644 --- a/Formula/kssd.rb +++ b/Formula/kssd.rb @@ -1,8 +1,8 @@ class Kssd < Formula desc "K-mer substring space sampling/shuffling decomposition" homepage "https://github.com/yhg926/public_kssd" - url "https://github.com/yhg926/public_kssd/archive/refs/tags/v1.1.tar.gz" - sha256 "bdf42a9a280126c41736aa9ee480d2948e32f9027e97607fe18473db59187bf4" + url "https://github.com/yhg926/public_kssd/archive/refs/tags/v2.21.tar.gz" + sha256 "2f6217b6e685dbe15c9aa4fa9a7eeb225651eb608f34799efea4ce84e2d0fd86" bottle do root_url "https://ghcr.io/v2/brewsci/bio" From 53f99662f1c6b42df31ab54fbe161b2176f44cf7 Mon Sep 17 00:00:00 2001 From: Benjamin Demaille Date: Wed, 8 Jul 2026 23:20:33 +0200 Subject: [PATCH 2/2] kssd: fix CI (patch heap off-by-one and version banner) kssd -V aborted with 'buffer overflow detected' (exit 134): long_domain is malloc'd one byte too small for 'domain ', which newer glibc _FORTIFY_SOURCE=3 now flags. Also bump the internal version string from 2.2 to 2.21 so the test's version assertion passes. Co-Authored-By: Claude Opus 4.8 (1M context) --- Formula/kssd.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Formula/kssd.rb b/Formula/kssd.rb index 8e32a103d..e288a23c1 100644 --- a/Formula/kssd.rb +++ b/Formula/kssd.rb @@ -13,6 +13,11 @@ class Kssd < Formula depends_on :linux depends_on "zlib" + # Fix a heap off-by-one (long_domain buffer too small by 1) that aborts with + # "buffer overflow detected" under glibc _FORTIFY_SOURCE=3, and bump the + # internal version banner (upstream left it at 2.2). + patch :DATA + def install system "make" bin.install "kssd" @@ -23,3 +28,24 @@ def install assert_match version.to_s, shell_output("#{bin}/kssd -V 2>&1") end end +__END__ +--- a/kssd.c ++++ b/kssd.c +@@ -17,7 +17,7 @@ + #include + #include + #include "global_basic.h" +-const char *argp_program_version = "kssd version 2.2"; ++const char *argp_program_version = "kssd version 2.21"; + const char *argp_program_bug_address = "yhg926@gmail.com"; + int main(int argc, char** argv) + { +@@ -26,7 +26,7 @@ + const char subcommand_n[] = ""; + domain = (char*) malloc(strlen(argv[0])+1); + strcpy(domain,argv[0]); +- long_domain = (char*) malloc( strlen(domain) + strlen(subcommand_n) + 1); ++ long_domain = (char*) malloc( strlen(domain) + strlen(subcommand_n) + 2); + snprintf(long_domain,strlen(domain) + strlen(subcommand_n) + 2,"%s %s",domain,subcommand_n); + cmd_global(argc, argv); + return 0;