Re: Importing pg_bsd_indent into our source tree

From: Efimtsev Fjodor <f(dot)efimtsev(at)ftdata(dot)ru>
To: "exclusion(at)gmail(dot)com" <exclusion(at)gmail(dot)com>
Cc: Grigorev Jurij <ju(dot)grigorev(at)ftdata(dot)ru>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Importing pg_bsd_indent into our source tree
Date: 2026-09-07 07:10:51
Message-ID: 8f9b2d2a11024e2ba03d072afc981ebf@localhost.localdomain
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alexander,

thank you for your patch.
I think your patched version of strspn() assumes that all of these are true:
- s1 is NULL-terminated or has characters not in s2;
- s2 doesn't contain '\n';
- s1 is not an empty string (pointing to NULL).

Also it redefines a libc function with a macro which doesn't seem very clean.

The attached version is safer in that it is bounded and avoids shadowing a stdlib function.

Regards,
Fedor Efimtsev

Attachment Content-Type Size
0001-fix-sanitizer-warning-in-src-tools-pg_bsd_indent-lex.patch text/x-patch 1.8 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuhang Qiu 2026-09-07 07:18:19 Re: [PATCH] Use streaming read I/O in sample scans
Previous Message Andrey Borodin 2026-09-07 06:53:24 Re: Python/pytest test framework take two