[Top][All Lists]

[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: Gecko/20060808 Fedora/ Firefox/ 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:


  Message sent via/by Savannah

reply via email to

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