* [PATCH] cpufreq: Fix sscanf robustness
@ 2013-12-11 18:35 Alan
2013-12-16 9:50 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Alan @ 2013-12-11 18:35 UTC (permalink / raw)
To: linux-pm
The cpufreq-set tool has a missing length check. This is basically
just correctness but still should get fixed.
One of a set of sscanf problems reported by Jackie Chang
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
tools/power/cpupower/utils/cpufreq-set.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
index dd1539e..a416de8 100644
--- a/tools/power/cpupower/utils/cpufreq-set.c
+++ b/tools/power/cpupower/utils/cpufreq-set.c
@@ -257,7 +257,7 @@ int cmd_freq_set(int argc, char **argv)
print_unknown_arg();
return -EINVAL;
}
- if ((sscanf(optarg, "%s", gov)) != 1) {
+ if ((sscanf(optarg, "%19s", gov)) != 1) {
print_unknown_arg();
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: Fix sscanf robustness
2013-12-11 18:35 [PATCH] cpufreq: Fix sscanf robustness Alan
@ 2013-12-16 9:50 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2013-12-16 9:50 UTC (permalink / raw)
To: Alan; +Cc: Linux PM list, Rafael J. Wysocki
On Thu, Dec 12, 2013 at 12:05 AM, Alan <gnomes@lxorguk.ukuu.org.uk> wrote:
> The cpufreq-set tool has a missing length check. This is basically
> just correctness but still should get fixed.
>
> One of a set of sscanf problems reported by Jackie Chang
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
> tools/power/cpupower/utils/cpufreq-set.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-16 9:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-11 18:35 [PATCH] cpufreq: Fix sscanf robustness Alan
2013-12-16 9:50 ` Viresh Kumar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.