host fst - error out if not initialized (prevents null deference later)

This commit is contained in:
Kelvin Sherlock 2018-07-16 13:52:56 -04:00
parent d1057c52f3
commit e886532dbe
2 changed files with 30 additions and 2 deletions

View File

@ -2558,6 +2558,7 @@ void host_fst(void) {
fprintf(stderr, "Host FST: %04x %s", call, call_name(call));
if (call & 0x8000) {
fputs("\n", stderr);
// system level.
@ -2574,14 +2575,27 @@ void host_fst(void) {
}
} else {
if (!root) {
acc = networkError;
engine.acc = acc;
SEC();
fprintf(stderr, " %02x %s\n", acc, error_name(acc));
return;
}
int class = call >> 13;
call &= 0x1fff;
if (class > 1) {
acc = invalidClass;
engine.acc = acc;
SEC();
engine.acc = invalidClass;
fprintf(stderr, " %02x %s\n", acc, error_name(acc));
return;
}
char *path1 = NULL;
char *path2 = NULL;
char *path3 = NULL;

View File

@ -2686,14 +2686,28 @@ void host_fst(void) {
}
} else {
if (!root) {
acc = networkError;
engine.acc = acc;
SEC();
fprintf(stderr, " %02x %s\n", acc, error_name(acc));
return;
}
int class = call >> 13;
call &= 0x1fff;
if (class > 1) {
acc = invalidClass;
engine.acc = acc;
SEC();
engine.acc = invalidClass;
fprintf(stderr, " %02x %s\n", acc, error_name(acc));
return;
}
char *path1 = NULL;
char *path2 = NULL;
char *path3 = NULL;