1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

io: bug fixes to avoid segemention faults

This commit is contained in:
Steffen Vogel 2018-05-13 14:21:50 +02:00
parent b470bb33aa
commit 17af0784e6
2 changed files with 8 additions and 3 deletions

View file

@ -97,13 +97,17 @@ int io_init(struct io *io, struct format_type *fmt, struct node *n, int flags)
io->input.buffer = alloc(io->input.buflen);
io->output.buffer = alloc(io->output.buflen);
if (n) {
io->input.node = n;
io->output.node = n;
io->input.node = n;
io->output.node = n;
if (n) {
io->input.signals = &n->signals;
io->output.signals = &n->signals;
}
else {
io->input.signals = NULL;
io->output.signals = NULL;
}
ret = io->_vt->init ? io->_vt->init(io) : 0;
if (ret)

View file

@ -130,6 +130,7 @@ check: if (optarg == endptr)
for (int i = 0; i < n; i++) {
s[i].format = format;
s[i].path = argv[optind + i];
s[i].io.state = STATE_DESTROYED;
s[i].fmt = format_type_lookup(s[i].format);
if (!s[i].fmt)