Re: [PATCH 1/3] str_to_val macro, improved conversion and checking of numerical args

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

 



On Fri, 18 Nov 2011 13:39:05 +0200
Alexander Nezhinsky <alexandern@xxxxxxxxxxxx> wrote:

> When a numerical command line param value is out of range or contains
> garbage (both tgtd and tgtadm), this remains unchecked in many cases.
> In some of them 0 value will be used, which may lead to unpredicted or
> "silently" faulty behavior.
> 
> This fix defines a new macro str_to_val() which uses strtoull() and
> detects its errors properly, by checking
> 1) errno (range errors) and 2) comparing endptr to the original argument
> (they remain equal in case of non-numerical garbage);
> 
> Signed-off-by: Alexander Nezhinsky <alexandern@xxxxxxxxxxxx>
> ---
>  usr/util.h |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)

The patch series has been applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux