aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorDaniel Wagner <wagi@monom.org>2018-04-03 17:10:30 +0200
committerDaniel Wagner <wagi@monom.org>2018-04-03 17:10:30 +0200
commit723e52ebf702b7dc5904552d09cc4de7cbe70913 (patch)
tree7eddce890ca246b352be32dcc0aa5852763acee8 /fs/cifs/netmisc.c
parent2f41b395fd2ef30c58f89816b0063159796f4410 (diff)
parentb766b14a48de577e5060e4d8762f1e4a34229d2b (diff)
Merge tag 'v4.4.124' into v4.4-rt
This is the 4.4.124 stable release
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index abae6dd2c6b9..cc88f4f0325e 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -980,10 +980,10 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
days = sd->Day;
month = sd->Month;
- if ((days > 31) || (month > 12)) {
+ if (days < 1 || days > 31 || month < 1 || month > 12) {
cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
- if (month > 12)
- month = 12;
+ days = clamp(days, 1, 31);
+ month = clamp(month, 1, 12);
}
month -= 1;
days += total_days_of_prev_months[month];