mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
mac80211: fix some snprintf misuses
In some debugfs related functions snprintf was used while scnprintf should have been used instead. (blindly adding the return value of snprintf and supplying it to the next snprintf might result in buffer overflow when the input is too big) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
ee4bc9e758
commit
f364ef99a8
3 changed files with 54 additions and 49 deletions
|
@ -47,17 +47,19 @@ static int ht_print_chan(struct ieee80211_channel *chan,
|
|||
return 0;
|
||||
|
||||
if (chan->flags & IEEE80211_CHAN_DISABLED)
|
||||
return snprintf(buf + offset,
|
||||
buf_size - offset,
|
||||
"%d Disabled\n",
|
||||
chan->center_freq);
|
||||
return scnprintf(buf + offset,
|
||||
buf_size - offset,
|
||||
"%d Disabled\n",
|
||||
chan->center_freq);
|
||||
|
||||
return snprintf(buf + offset,
|
||||
buf_size - offset,
|
||||
"%d HT40 %c%c\n",
|
||||
chan->center_freq,
|
||||
(chan->flags & IEEE80211_CHAN_NO_HT40MINUS) ? ' ' : '-',
|
||||
(chan->flags & IEEE80211_CHAN_NO_HT40PLUS) ? ' ' : '+');
|
||||
return scnprintf(buf + offset,
|
||||
buf_size - offset,
|
||||
"%d HT40 %c%c\n",
|
||||
chan->center_freq,
|
||||
(chan->flags & IEEE80211_CHAN_NO_HT40MINUS) ?
|
||||
' ' : '-',
|
||||
(chan->flags & IEEE80211_CHAN_NO_HT40PLUS) ?
|
||||
' ' : '+');
|
||||
}
|
||||
|
||||
static ssize_t ht40allow_map_read(struct file *file,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue