| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | Re: [PATCH 04/19] mkfs: validate all input values |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Wed, 6 Apr 2016 18:02:17 -0500 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1458818136-56043-5-git-send-email-jtulak@xxxxxxxxxx> |
| References: | <1458818136-56043-1-git-send-email-jtulak@xxxxxxxxxx> <1458818136-56043-5-git-send-email-jtulak@xxxxxxxxxx> |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
On 3/24/16 6:15 AM, jtulak@xxxxxxxxxx wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
>
> CHANGELOG
> o Fix an unsigned < 0 comparison - save getnum result to another variable
> and test it, before converting it to unsigned logagno.
...
> @@ -1468,7 +1485,10 @@ main(
> respec('l', lopts, L_AGNUM);
> if (ldflag)
> conflict('l', lopts, L_AGNUM,
> L_DEV);
> - logagno = atoi(value);
> + tmp_num = getnum(value, 0, 0, false);
> + if (tmp_num < 0)
> + illegal(value, "l agno");
> + logagno = (xfs_agnumber_t)tmp_num;
> laflag = 1;
> break;
> case L_FILE:
Why not cast to (__int64_t) like other variables do? i.e.
+ logagno = getnum(value, 0, 0, false);
+ if ((__int64_t)logagno < 0)
+ illegal(value, "l agno");
or am I missing something?
Thanks,
-Eric
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 19/19] mkfs: add optional 'reason' for illegal_option, Eric Sandeen |
|---|---|
| Next by Date: | Re: [PATCH 03/19] mkfs: Sanitise the superblock feature macros, Eric Sandeen |
| Previous by Thread: | Re: [PATCH 19/19] mkfs: add optional 'reason' for illegal_option, Eric Sandeen |
| Next by Thread: | Re: [PATCH 04/19] mkfs: validate all input values, Jan Tulak |
| Indexes: | [Date] [Thread] [Top] [All Lists] |