aboutsummaryrefslogtreecommitdiffstats
path: root/ncpd
diff options
context:
space:
mode:
Diffstat (limited to 'ncpd')
-rw-r--r--ncpd/socketchan.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ncpd/socketchan.cc b/ncpd/socketchan.cc
index 407464a..371befd 100644
--- a/ncpd/socketchan.cc
+++ b/ncpd/socketchan.cc
@@ -207,6 +207,13 @@ socketPoll()
//
// All commands begin with "NCP$".
+ if (memchr(a.getString(), 0, a.getLen()) == 0) {
+ // Not 0 terminated, -> invalid
+ cerr << "ncpd: command " << a << " unrecognized."
+ << endl;
+ return;
+ }
+
// There is a magic process name called "NCP$INFO.*"
// which is announced by the rfsvfactory. This causes a
// response to be issued containing the NCP version