Skip to content

Commit 23c9ff8

Browse files
committed
Fix off-by-one problems in git_signature__parse
Etc/GMT-14 aka UTC+14:00 is a thing.... https://en.wikipedia.org/wiki/UTC%2B14:00 Also allow offsets on the last minute (59). Addresses: https://bugs.debian.org/841532 Fixes: libgit2#3970
1 parent c655def commit 23c9ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/signature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
251251
* only store timezone if it's not overflowing;
252252
* see http://www.worldtimezone.com/faq.html
253253
*/
254-
if (hours < 14 && mins < 59) {
254+
if (hours <= 14 && mins <= 59) {
255255
sig->when.offset = (hours * 60) + mins;
256256
if (tz_start[0] == '-')
257257
sig->when.offset = -sig->when.offset;

0 commit comments

Comments
 (0)