Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.perl5.changes > #34315

[Perl/perl5] da0069: embed.fnc: Add ptr args assert for unpack_rec, unp...

Newsgroups perl.perl5.changes
Path csiph.com!fu-berlin.de!bofh.it!nntp.perl.org
Xref csiph.com perl.perl5.changes:34315
Return-Path <noreply@github.com>
Mailing-List contact perl5-changes-help@perl.org; run by ezmlm
Delivered-To mailing list perl5-changes@perl.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=perl.org; h=date :from:to:message-id:subject:mime-version:content-type :content-transfer-encoding:list-unsubscribe:reply-to; s=dr1; bh= JBV1Gw5rxldtxUHkmElgYXAw+c6+4rb0cI7c2BC6/G0=; b=lY5/HLtjnradjYwO LhrYDnC+ylRdvYeDP3hEKAL683KC4VtrnSS8T6DNwOr3UZojzhVriuH0n4xkJ9+s Yu4U7lly0Ut1PT9blEA1GSr7Ons/KWJD4UXoAd1L9n2mYRrCIECmakUABAXksun6 ebm3a4TG30Lywck8rcgOxYX+IQRNlBEaqOirGGv8yihTiObA8QGfMZ1ojdPgTnVX NjjOTtRgjoO8TaTnGNk2tgNDV1LeBmkWt2sCuLSyNZ1w2dAGOu3QgfGDGwggJqzd PZx4h7TRomB7QJNhah95A/NdIadNxlG5ahOQ3oeYNDazkX+qoTcbje/3yYMkPwkL GskUVg==
Received (qmail 15089 invoked from network); 30 Jan 2026 19:34:30 -0000
Received from xx1.develooper.com (147.75.38.233) by x6.develooper.com with SMTP; 30 Jan 2026 19:34:30 -0000
Received from inbound-egress-11.mailchannels.net (inbound-egress-11.mailchannels.net [23.83.208.2]) by xx1.develooper.com (Postfix) with ESMTP id 9897F7C1A7 for <perl5-changes@perl.org>; Fri, 30 Jan 2026 11:34:30 -0800 (PST)
ARC-Seal i=1; a=rsa-sha256; d=mailchannels.net; s=arc-2022; cv=none; t=1769801669; b=q4LzX+MXyrrF83VQkUUxiO7KWwtrgDRWupdvBhlfYsHUpMD0cxVdmMPqhMPlmYwxKtUHZ4 6mQvIsuXPEQfEewqT+iGpcYqSMxQF43cJZnX1dOeyGVvSaEg0NsJGokyo1GLp2oPTMtyW9 Nm1tgWqt20bZiv61diWvQBznhUAPCc0bfFTVkIc+kQuG28HT0WtjbTsz/rointQ0aRY0m/ ijmzpPRGet8EyEtn+g3gj8yKn5Q/gvqZhOg5yIb1z0ntyOzhU/NzxLkOSyQH4hxw/gyHRJ HM+WKQ3C7KiDGBUjQ9yEO3UF2cfw1ChafT0Dlgw4C4ar9WMnQmTv/mVLfOhhPA==
ARC-Message-Signature i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1769801669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-unsubscribe: dkim-signature; bh=JBV1Gw5rxldtxUHkmElgYXAw+c6+4rb0cI7c2BC6/G0=; b=ZnMfR2IpdJmGt161VbJ4kKzo5kcwb2xqdJ+7f4ImLJFSIekxd0NQIe1y8ODk0zei7nbZDp Je9j1J7UJRCc7exFXLeJRRcF8XuaEdbi064FnyXNLoSWhHJtmeft9jLoO+cGdUhLz2Cej+ tRQ3zzNGjkgTzP+ybDJmLe2cjNsGyI7+9Gu/3F875gNg1yPLSOaIDWO0ayqWRMij2tWiNV YIu3TaYOf74WYpZSv7Uwx5Hw/JN/cvBS0/5cLTHYdMztBaKeyrwCpt2xVfBrYt8slb84By R4zTaII2KDd+FIvbU523OYSjM2grSHPzbsMUyNryacJg4izIuaGYB32TFjVoFQ==
ARC-Authentication-Results i=1; inbound-rspamd-d7bfdcbd8-wf5km; none
X-Message-ID e6eogBHWG06TRyCYP7PzRWl9
Received from out-28.smtp.github.com (out-28.smtp.github.com [192.30.252.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.122.99.89 (trex/7.1.3); Fri, 30 Jan 2026 19:34:29 +0000
Authentication-Results inbound.mailchannels.net; spf=pass smtp.mailfrom=noreply@github.com; dkim=pass header.d=github.com; dmarc=pass (policy=reject; pct=100; status=pass); arc=none
Received-SPF pass (dmarc-service-6ccc8c884f-fz5kp: domain of github.com designates 192.30.252.211 as permitted sender) client-ip=192.30.252.211; envelope-from=noreply@github.com; helo=out-28.smtp.github.com;
Received from github.com (hubbernetes-node-9cb19bb.ash1-iad.github.net [10.56.143.42]) by smtp.github.com (Postfix) with ESMTPA id 639F99208AB for <perl5-changes@perl.org>; Fri, 30 Jan 2026 11:34:28 -0800 (PST)
Date Fri, 30 Jan 2026 11:34:28 -0800
To perl5-changes@perl.org
Message-ID <Perl/perl5/push/refs/heads/blead/a3330e-da0069@github.com> (permalink)
Subject [Perl/perl5] da0069: embed.fnc: Add ptr args assert for unpack_rec, unp...
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-GitHub-Recipient-Address perl5-changes@perl.org
X-Auto-Response-Suppress All
Original-From Karl Williamson <noreply@github.com>
Reply-To Karl Williamson <noreply@github.com>,
Approved news@nntp.perl.org
From perl5-changes@perl.org (Karl Williamson via perl5-changes)

Show key headers only | View raw


  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: da0069eeb43c24e88dadfd16e89793230ba9e8e7
      https://github.com/Perl/perl5/commit/da0069eeb43c24e88dadfd16e89793230ba9e8e7
  Author: Karl Williamson <khw@cpan.org>
  Date:   2026-01-30 (Fri, 30 Jan 2026)

  Changed paths:
    M embed.fnc
    M proto.h

  Log Message:
  -----------
  embed.fnc: Add ptr args assert for unpack_rec, unpackstring

unpackstring(), which is public API,  does some setup and calls
unpack_rec(), which is an internal function.

Each function takes two strings as arguments; each string is denoted by
a beginning and ending pointer.  The documentation for unpackstring()
says that the end pointers for both strings should point to one byte
beyond the final byte of the respective string.  This is false.  The end
pointers can point to the same byte as their respective start pointers.
And the test suite has tests where that gets exercised.

Thus the documentation says that the end pointer must be greater than
the start pointer, but the functions do get tested (and pass) with the
end pointer equal to the start pointer.  It turns out that in each case
of that in the test suite, that that byte is NUL.  Given the
documentation, I wondered if it being NUL is a requirement for proper
operation.  I considered adding an EPTRgt_or_NUL rule for these two
functions.

To that end, I read the code to see if they would work without it being
NUL.  In the case of the pattern string, yes, it would work without that
being NUL, so the assertion can be the existing EPTRge.

I gave up checking this for the target string argument.  The uses of
this are quite complex, and little documented, with many paths through
the code.  Some paths I traced do work without the byte being NUL.  But
I don't know about all paths.  So I changed this assertion as well to
EPTRge.

I decided to leave the documentation as-is, so callers will try to use a
strictly gt paradigm.



To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications

Back to perl.perl5.changes | Previous | Next | Find similar | Unroll thread


Thread

[Perl/perl5] da0069: embed.fnc: Add ptr args assert for unpack_rec, unp... perl5-changes@perl.org (Karl Williamson via perl5-changes) - 2026-01-30 11:34 -0800

csiph-web