|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 2/4] Add access control support toqemu-bridge-helper |
Date: | Wed, 04 Nov 2009 08:23:01 -0600 |
User-agent: | Thunderbird 2.0.0.23 (X11/20090825) |
Krumme, Chris wrote:
Hello Anthony, Cool patch series.
Thanks.
+ cmd = ptr; + arg = strchr(cmd, ' '); + if (arg == NULL) { + arg = strchr(cmd, '\t'); + } + + if (arg == NULL) { + fprintf(stderr, "Invalid config line:\n %s\n", line); + fclose(f); + errno = EINVAL; + return -1; + } + + *arg = 0;No check is made for arg being in bounds.
I don't get it. arg is either going to be NULL (no ' ' or '\t' found in the string) or it will point to the first ' ' or '\t' in the string. It will always be in bound in this second case and the first case is handled by the if().
Regards, Anthony Liguori
[Prev in Thread] | Current Thread | [Next in Thread] |