bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #5280] environment size is not subtracted in one case


From: Miloslav Trmac
Subject: [patch #5280] environment size is not subtracted in one case
Date: Mon, 28 Aug 2006 16:30:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; cs-CZ; rv:1.8.0.6) Gecko/20060808 Fedora/1.5.0.6-2.fc5 Firefox/1.5.0.6 pango-text

Follow-up Comment #2, patch #5280 (project findutils):

The relevant condition is basically
if (128K + env_size <= ctl->posix_arg_size_max
    && 128K + env_size >= ctl->posix_arg_size_min)
  arg_max = 128K + env_size;

... thus find attempts to use 128K + 2*env_size, which can fail
if 128K + 2 * env_size > ARG_MAX.

The first condition is equivalent to
if (128K + env_size <= ARG_MAX - 2K && ...)

So find can fail
if (env_size <= ARG_MAX - 130K && 2*env_size > ARG_MAX - 128K);

ARG_MAX = 128K on Linux, so the bug can't happen on Linux.  I don't
know what ARG_MAX is in other operating systems.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?5280>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]