diff options
author | Mathieu J. Poirier <mathieu.poirier@linaro.org> | 2013-04-10 09:20:21 -0600 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2013-07-17 15:41:25 +0100 |
commit | 1dbe4c10094e7a818d31f8e5ff4876574fc33b90 (patch) | |
tree | ce8a079dd0e32c96ba2e0bf393771a93213ac80e /drivers/switch | |
parent | 572ba82058db020eebf10edcf0abde05171c72e6 (diff) |
cpufreq/arm_big_little.c: Fixing non-terminated string
When declaring char name[9] = "cluster";
name[7] is equal to the string termination character '\0'.
But later on doing:
name[7] = cluster_id + '0';
clobbers the termination character, leaving non terminated
strings in the system and potentially causing undertermined
behavior.
By initialising name[9] to "clusterX" the 8th character is
set to '\0' and affecting the 7th character with the cluster
number doesn't overwite anything.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
[ np: The C standard says that the reminder of an initialized array of
a known size should be initialized to zero and therefore this patch is
unneeded, however this patch makes the intent more explicit to others
reading the code. ]
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'drivers/switch')
0 files changed, 0 insertions, 0 deletions