linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: Steve French <smfrench@gmail.com>
Cc: samba-technical <samba-technical@lists.samba.org>,
	CIFS <linux-cifs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Pavel Shilovsky <piastryyy@gmail.com>
Subject: Re: [PATCH][smbinfo cifsutils]
Date: Thu, 28 Mar 2019 17:02:19 +0100	[thread overview]
Message-ID: <20190328170219.29c72cbf@echidna.suse.de> (raw)
In-Reply-To: <CAH2r5mvQ+KmoBgoxT51SRMpCXZ4OFwg+B1x_SD3DFkcrUcdZQQ@mail.gmail.com>

On Thu, 28 Mar 2019 05:05:35 -0500, Steve French wrote:

> +	/* Now that we know the size, query the list from the server */
> +
> +	/* Make sure the buf size is big enough even to handle unexpected server behavior */
> +	buf = malloc(snap_inf.snapshot_array_size + 300);

The buffer length calculations seem pretty arbitrary here, wouldn't it
make sense to use something like the following (with a maximum limit)?
sizeof(struct smb_snapshot_array) +
	(snap_inf.number_of_snapshots * GMT_TOKEN_LEN)

Cheers, David

  parent reply	other threads:[~2019-03-28 16:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 10:05 [PATCH][smbinfo cifsutils] Steve French
2019-03-28 10:24 ` ronnie sahlberg
2019-03-28 16:02 ` David Disseldorp [this message]
2019-03-29  8:14   ` Steve French
2019-03-29 18:44     ` Steve French
2019-03-29 19:05       ` Pavel Shilovsky

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=20190328170219.29c72cbf@echidna.suse.de \
    --to=ddiss@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=piastryyy@gmail.com \
    --cc=samba-technical@lists.samba.org \
    --cc=smfrench@gmail.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;
as well as URLs for NNTP newsgroup(s).