public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Fabian Ebner <f.ebner@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH perlmod] array: avoid underflow when array is empty and more is zero
Date: Tue, 9 Mar 2021 15:35:41 +0100	[thread overview]
Message-ID: <20210309143541.x64pqiv7wftmekwn@wobu-vie.proxmox.com> (raw)
In-Reply-To: <20210218124743.6974-1-f.ebner@proxmox.com>

applied, but note that I re-formatted this (if-body in a new line,
semicolon inside instead of outside).

On Thu, Feb 18, 2021 at 01:47:43PM +0100, Fabian Ebner wrote:
> serializing an empty array triggered this.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  perlmod/src/array.rs | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/perlmod/src/array.rs b/perlmod/src/array.rs
> index ce6e112..f0bce57 100644
> --- a/perlmod/src/array.rs
> +++ b/perlmod/src/array.rs
> @@ -102,6 +102,7 @@ impl Array {
>  
>      /// Pre-extend the array to up to the specified length..
>      pub fn reserve(&self, more: usize) {
> +        if more == 0 { return };
>          let idx = self.len() + more - 1;
>          unsafe {
>              ffi::RSPL_av_extend(self.av(), idx as libc::ssize_t);
> -- 
> 2.20.1




      reply	other threads:[~2021-03-09 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 12:47 [pbs-devel] " Fabian Ebner
2021-03-09 14:35 ` Wolfgang Bumiller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210309143541.x64pqiv7wftmekwn@wobu-vie.proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal