diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2022-01-03 13:48:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 13:48:39 +0100 |
commit | 2714df42fd27ec377228a102acff3744d6bff86d (patch) | |
tree | 3098fa3d9be4826e5da9d1df39ecf6b42bf3570b /plugins/check_ups.c | |
parent | 11af74de386ba7c02d5d0e53f2500b5029a4537d (diff) | |
parent | 78a999edd4dd3305ef8fa3e06c43f6a893fb6fea (diff) | |
download | monitoring-plugins-2714df42fd27ec377228a102acff3744d6bff86d.tar.gz |
Merge branch 'master' into master
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 |