[pacman-dev] [PATCH 1/3] paccache: allow strictly integer for -k option
Verify the argument to -k is a non-negative integer. Leading zeros
are simply tripped.
'declare -i keep' allowed the argument to -k to be any arithmetic
evaluation expression. The simple assignment 'keep=$OPTARG' triggers
arithmetic evaluation implicitly, which can either consume a huge amount
of resources with input such as '2**2**32' or immediately produce an error
on invalid input. Instead, we simply 'declare -- keep' and avoid all that.
Signed-off-by: lolilolicon
Declare and initialize integer variables 'needsroot' and 'verbose'.
Don't use the fact that (( undefined_variable )) evaluates to 0.
Signed-off-by: lolilolicon
Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.
Signed-off-by: lolilolicon
On Thu, Sep 29, 2011 at 10:45 AM, lolilolicon
Verify the argument to -k is a non-negative integer. Leading zeros are simply tripped.
Oops, sorry s/tripped/stripped/ there.
Dave, will you correct this typo for me, or should I resend the patch?
May I ask how should I resend a v2 patch in this case? Something like:
git send-email --in-reply-to '
On Thu, Sep 29, 2011 at 10:58:14AM +0800, lolilolicon wrote:
On Thu, Sep 29, 2011 at 10:45 AM, lolilolicon
wrote: Verify the argument to -k is a non-negative integer. Leading zeros are simply tripped.
Oops, sorry s/tripped/stripped/ there. Dave, will you correct this typo for me, or should I resend the patch?
done. pushed to my paccache branch on GH.
May I ask how should I resend a v2 patch in this case? Something like:
git send-email --in-reply-to '
' v2.patch Is that OK or is there a better way to do it?
Yep, that's fine. d
participants (2)
-
Dave Reisner
-
lolilolicon