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


Groups > linux.kernel > #1703264 > unrolled thread

Re: [PATCH v2] zram: Rework copy of compressor name in comp_algorithm_store()

Started byDoug Anderson <dianders@chromium.org>
First post2017-08-03 18:40 +0200
Last post2017-08-03 18:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] zram: Rework copy of compressor name in comp_algorithm_store() Doug Anderson <dianders@chromium.org> - 2017-08-03 18:40 +0200

#1703264 — Re: [PATCH v2] zram: Rework copy of compressor name in comp_algorithm_store()

FromDoug Anderson <dianders@chromium.org>
Date2017-08-03 18:40 +0200
SubjectRe: [PATCH v2] zram: Rework copy of compressor name in comp_algorithm_store()
Message-ID<uarkf-2yP-23@gated-at.bofh.it>
Hi,

On Thu, Aug 3, 2017 at 9:33 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> comp_algorithm_store() passes the size of the source buffer to strlcpy()
> instead of the destination buffer size. Make it explicit that the two
> buffers have the same size and use strcpy() instead of strlcpy().
> The latter can be done safely since the function ensures that the string
> in the source buffer is terminated.
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> Changes in v2:
> - make destination buffer explicitly of the same size as source buffer
> - use strcpy() instead of strlcpy()
> - updated subject and commit message
>
>  drivers/block/zram/zram_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Looks great.  Commit message could be explicit that this change fixes
no bugs and is mostly a no-op (strcpy may be slightly faster than
strlcpy), but I guess that's obvious to anyone looking at the patch.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web