Non-object public IP JSON responses can crash consumers
Author: xu91102Created Sep 26, 2026Updated Sep 27, 2026
Labelsplugin/ip
The public IP polling worker accepts any valid JSON response and replaces its shared information dictionary with it. A service returning false, a number or a string then causes public_info to raise AttributeError when copying it; an array is also passed to code expecting a mapping.
Expected non-object responses to be ignored, preserving the last successful IP information, just like a failed JSON/network request. A regression runs one real polling-loop iteration with mocked HTTP responses for booleans, numbers, strings, arrays and null. Six cases fail on develop; a valid object case passes.
Environment: Python 3.12.13, macOS, current develop. Prepared with Codex assistance.
Source: nicolargo/glances