FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

time.c: fixed a potential buffer overflow in `time_zonename`. · mruby/mruby@26340a8 · GitHub

/ mruby Public

Commit 26340a8

Browse files
committed
time.c: fixed a potential buffer overflow in time_zonename.
1 parent c2c0250 commit 26340a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎mrbgems/mruby-time/src/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ time_zonename(mrb_state *mrb, struct mrb_time *tm, char *buf, size_t len)
695695
datetime.tm_hour = offset / 60;
696696
datetime.tm_min = offset % 60;
697697
buf[0] = utc_sec < tm->sec ? '-' : '+';
698-
return strftime(buf+1, len, "%H%M", &datetime) + 1;
698+
return strftime(buf+1, len-1, "%H%M", &datetime) + 1;
699699
#else
700700
return strftime(buf, len, "%z", &tm->datetime);
701701
#endif

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL