Skip to content

Commit 49c94e4

Browse files
committed
Fixed a few potential crashes with check_nt
1 parent 410479c commit 49c94e4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

modules/NSClientServer/NSClientServer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,16 @@ check_nt::packet NSClientServer::handle(check_nt::packet p) {
326326
return check_nt::packet(extract_perf_value(payload.perf(0)));
327327

328328
case REQ_MEMUSE:
329+
if (payload.perf_size() < 1)
330+
return check_nt::packet("ERROR: Invalid return from command: " + cmd.first);
329331
return check_nt::packet(extract_perf_total(payload.perf(0)) + "&" + extract_perf_value(payload.perf(0)));
330332
case REQ_USEDDISKSPACE:
333+
if (payload.perf_size() < 1)
334+
return check_nt::packet("ERROR: Invalid return from command: " + cmd.first);
331335
return check_nt::packet(extract_perf_value(payload.perf(0)) + "&" + extract_perf_total(payload.perf(0)));
332336
case REQ_FILEAGE:
337+
if (payload.perf_size() < 1)
338+
return check_nt::packet("ERROR: Invalid return from command: " + cmd.first);
333339
return check_nt::packet(strEx::s::xtos_non_sci(extract_perf_value_i(payload.perf(0))/60) + "&" + payload.message());
334340

335341
case REQ_SERVICESTATE: // Some check_nt commands return the return code (coded as a string)

version.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version=0.4.3
2-
build=133
3-
date=2015-02-26
2+
build=138
3+
date=2015-04-08

0 commit comments

Comments
 (0)