Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2168

Use consistent int types for APM fields and snprintf for string conversions

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Several things I noticed dating back to the original implementation in PHPC-349:

      • Structs use uint64_t for fields where libmongoc's API returns int64_t. It's unlikely that these values would ever be negative, but we should keep the original type.
      • Request and operation ID are printed as unsigned strings. If a negative value was returned by libmongoc for some reason, this would alter it.
      • Printing request and operation ID uses sprintf. Although it's unlikely we'd overflow the string buffer, it'd be safer to use snprintf as we do in the ZVAL_INT64_STRING macro.

      I came across this while working on PHPC-2143.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: