# Output of scan/run_scan_demo.sh — 2026-10-15T04:45:36Z, cargo 1.97.0 (c980f4866 2026-06-30)

== Scan a sample legacy billing module (storage, arithmetic, embedded date, label) ==
time_scan — PFRG Year 2038 exposure scan
No files are modified. Each finding is a place to review, not a confirmed defect.

/home/claude/stb/safe_time_bridge/scan/samples/billing.c
     6  HIGH   STORED     time/date value may be held in a 32-bit field (int32_t)
        | typedef int32_t billing_time;              /* 32-bit time field: 2038-exposed storage */
     8  MEDIUM EMBEDDED   literal 1924905600 decodes to 2030-12-31 (a date compiled into the program)
        | static const int32_t TRIAL_ENDS = 1924905600;   /* 2031-01-01: a date compiled in */
    11  HIGH   STORED     time/date value may be held in a 32-bit field (int32_t)
        | int32_t now = (int32_t)time(NULL);     /* narrowing to 32 bits */
    11  INFO   LABEL      time() call; on a 32-bit time_t target this is the 2038 source
        | int32_t now = (int32_t)time(NULL);     /* narrowing to 32 bits */
    12  HIGH   ARITHMETIC arithmetic on a time value (overflows inside the program)
        | int32_t due = now + 30 * 86400;        /* +30 days: internal arithmetic */
    13  HIGH   ARITHMETIC arithmetic on a time value (overflows inside the program)
        | return (due - invoice_time) / 86400;
    19  MEDIUM LABEL      time formatted or logged via gmtime (label use)
        | gmtime_r(&(time_t){t}, &tmv);
    20  MEDIUM LABEL      time formatted or logged via strftime (label use)
        | strftime(buf, sizeof buf, "%Y-%m-%d", &tmv);   /* label use */
    21  MEDIUM LABEL      time formatted or logged via printf (label use)
        | printf("invoice date: %s\n", buf);

Scanned 1 file(s). 9 finding(s): ARITHMETIC 2, EMBEDDED 1, LABEL 4, STORED 2.

== Scan a module that only labels events with 64-bit time (low risk) ==
time_scan — PFRG Year 2038 exposure scan
No files are modified. Each finding is a place to review, not a confirmed defect.

/home/claude/stb/safe_time_bridge/scan/samples/logger_ok.c
     7  INFO   LABEL      time() call; on a 32-bit time_t target this is the 2038 source
        | int64_t t = (int64_t)time(NULL);       /* 64-bit; only used as a label below */

Scanned 1 file(s). 1 finding(s): LABEL 1.

== Scan this project's own model legacy programs ==
        | int32_t left = (int32_t)((uint32_t)expires - (uint32_t)now) / 86400;

Scanned 2 file(s). 13 finding(s): ARITHMETIC 3, EMBEDDED 1, LABEL 6, STORED 3.
