소스 검색

fix timezone parser code crashing on 64bit sys

if sizeof(time_t) == 8, this code path was missing the correct
offset into the zoneinfo file, using the header magic to do
offset calculations.
the 6 32bit fields to be read start at offset 20.
rofl0r 11 년 전
부모
커밋
e2ed37bc15
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/time/__tz.c

+ 1 - 1
src/time/__tz.c

@@ -176,7 +176,7 @@ static void do_tzset()
 	if (map) {
 		int scale = 2;
 		if (sizeof(time_t) > 4 && map[4]=='2') {
-			size_t skip = zi_dotprod(zi, VEC(1,1,8,5,6,1), 6);
+			size_t skip = zi_dotprod(zi+20, VEC(1,1,8,5,6,1), 6);
 			trans = zi+skip+44+20;
 			scale++;
 		} else {