Avoid potential overflow

pull/11396/head
George Psimenos 2019-09-02 15:48:30 +01:00
parent 4df70449fe
commit 93cebc189c
1 changed files with 1 additions and 1 deletions

View File

@ -1140,7 +1140,7 @@ bool AT_CellularSMS::create_time(const char *time_string, time_t *time)
&time_struct.tm_hour, &time_struct.tm_min, &time_struct.tm_sec, &sign, &gmt) == kNumberOfElements) { &time_struct.tm_hour, &time_struct.tm_min, &time_struct.tm_sec, &sign, &gmt) == kNumberOfElements) {
*time = mktime(&time_struct); *time = mktime(&time_struct);
// add timezone as seconds. gmt is in quarter of hours. // add timezone as seconds. gmt is in quarter of hours.
int x = (60 * 60 * gmt) / 4; int x = (60 / 4) * 60 * gmt;
if (sign == '+') { if (sign == '+') {
*time += x; *time += x;
} else { } else {