diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_ssh.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index af7089a7..b4a98cdf 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c | |||
| @@ -255,12 +255,11 @@ int ssh_connect(mp_check *overall, char *haddr, int hport, char *desired_remote_ | |||
| 255 | byte_offset = 0; | 255 | byte_offset = 0; |
| 256 | 256 | ||
| 257 | char *index = NULL; | 257 | char *index = NULL; |
| 258 | size_t len = 0; | ||
| 259 | while ((index = strchr(output + byte_offset, '\n')) != NULL) { | 258 | while ((index = strchr(output + byte_offset, '\n')) != NULL) { |
| 260 | /*Partition the buffer so that this line is a separate string, | 259 | /*Partition the buffer so that this line is a separate string, |
| 261 | * by replacing the newline with NUL*/ | 260 | * by replacing the newline with NUL*/ |
| 262 | output[(index - output)] = '\0'; | 261 | output[(index - output)] = '\0'; |
| 263 | len = strlen(output + byte_offset); | 262 | size_t len = strlen(output + byte_offset); |
| 264 | 263 | ||
| 265 | if ((len >= 4) && (strncmp(output + byte_offset, "SSH-", 4) == 0)) { | 264 | if ((len >= 4) && (strncmp(output + byte_offset, "SSH-", 4) == 0)) { |
| 266 | /*if the string starts with SSH-, this _should_ be a valid version control string*/ | 265 | /*if the string starts with SSH-, this _should_ be a valid version control string*/ |
