From f8f1f5b627964c9640a86375e0867c9dce1f2cce Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 8 Apr 2026 20:44:15 +0200 Subject: [PATCH] BUGFIX: LOC record latitude/longitude overflow on 32 bit archs --- models/record.go | 4 ++-- pkg/js/helpers.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/record.go b/models/record.go index 4635d6eb8e..61abda5e2f 100644 --- a/models/record.go +++ b/models/record.go @@ -172,8 +172,8 @@ func (rc *RecordConfig) UnmarshalJSON(b []byte) error { LocSize uint8 `json:"locsize,omitempty"` LocHorizPre uint8 `json:"lochorizpre,omitempty"` LocVertPre uint8 `json:"locvertpre,omitempty"` - LocLatitude int `json:"loclatitude,omitempty"` - LocLongitude int `json:"loclongitude,omitempty"` + LocLatitude uint32 `json:"loclatitude,omitempty"` + LocLongitude uint32 `json:"loclongitude,omitempty"` LocAltitude uint32 `json:"localtitude,omitempty"` LuaRType string `json:"luartype,omitempty"` NaptrOrder uint16 `json:"naptrorder,omitempty"` diff --git a/pkg/js/helpers.js b/pkg/js/helpers.js index 6fec6e92df..7190f2eb76 100644 --- a/pkg/js/helpers.js +++ b/pkg/js/helpers.js @@ -874,8 +874,8 @@ function locStringBuilder(record, args) { // Renders LOC type internal properties from D˚M'S" parameters. // Change anything here at your peril. function locDMSBuilder(record, args) { - LOCEquator = 1 << 31; // RFC 1876, Section 2. - LOCPrimeMeridian = 1 << 31; // RFC 1876, Section 2. + LOCEquator = Math.pow(2, 31); // RFC 1876, Section 2. + LOCPrimeMeridian = Math.pow(2, 31); // RFC 1876, Section 2. LOCHours = 60 * 1000; LOCDegrees = 60 * LOCHours; LOCAltitudeBase = 100000;