diff options
| author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-12-02 15:11:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-02 15:11:21 +0100 |
| commit | df1e9e975f69c8f7965bab91684870fe509739c6 (patch) | |
| tree | 526b0c77c524b2219d5a48fd78b8302f055a4a5b /plugins/check_ups.c | |
| parent | 6246b8f1830e8a375bc656deafd28aab715b4fd9 (diff) | |
| parent | 1a3a715702a5b6709fed2a1eb53ec644c9968057 (diff) | |
| download | monitoring-plugins-df1e9e975f69c8f7965bab91684870fe509739c6.tar.gz | |
Merge branch 'master' into mailq-add-config-dir
Diffstat (limited to 'plugins/check_ups.c')
| -rw-r--r-- | plugins/check_ups.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_ups.c b/plugins/check_ups.c index e9e56a51..0de37a20 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c | |||
| @@ -402,7 +402,10 @@ get_ups_variable (const char *varname, char *buf, size_t buflen) | |||
| 402 | 402 | ||
| 403 | /* create the command string to send to the UPS daemon */ | 403 | /* create the command string to send to the UPS daemon */ |
| 404 | /* Add LOGOUT to avoid read failure logs */ | 404 | /* Add LOGOUT to avoid read failure logs */ |
| 405 | sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname); | 405 | if (snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname) >= sizeof(send_buffer)) { |
| 406 | printf("%s\n", _("UPS name to long for buffer")); | ||
| 407 | return ERROR; | ||
| 408 | } | ||
| 406 | 409 | ||
| 407 | /* send the command to the daemon and get a response back */ | 410 | /* send the command to the daemon and get a response back */ |
| 408 | if (process_tcp_request | 411 | if (process_tcp_request |
