fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/42842?usp=email )
Change subject: client: Fix 32-bit overflow when computing pcapng EPB timestamp ...................................................................... client: Fix 32-bit overflow when computing pcapng EPB timestamp tv_sec * 1000 * 1000 was evaluated in int arithmetic. Where time_t / tv_sec is 32-bit, this overflows for any tv_sec > ~2147, corrupting the 64-bit timestamp_usec well before the year 2038. Cast tv_sec to uint64_t before the multiplication so the whole expression is computed in 64 bits. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Change-Id: I20d3282b8cba1675ce2d0860e66027e5ee8245ef --- M src/osmo_client_network.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/42/42842/1 diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index 4b91429..69308fe 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -207,7 +207,7 @@ int rc; epb_pars = (struct osmo_pcapng_file_epb_pars){ - .timestamp_usec = (pkthdr->ts.tv_sec * 1000 * 1000) + pkthdr->ts.tv_usec, + .timestamp_usec = ((uint64_t)pkthdr->ts.tv_sec * 1000 * 1000) + pkthdr->ts.tv_usec, .interface_id = ph->idx, .captured_data = data, .captured_len = pkthdr->caplen, -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/42842?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I20d3282b8cba1675ce2d0860e66027e5ee8245ef Gerrit-Change-Number: 42842 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <[email protected]>
