Re: [PATCH] Revert "initd: fix off-by-one error in mkdev.c"

2021-08-31 Thread Daniel Golle
On Tue, Aug 31, 2021 at 11:13:31AM +0200, Nick wrote: > Yep. Thanks. Just added another patch that is fixing the issue. I went to > some internet sources and code to see how other people handle the issue and > seems like everyone is just subtracting 1. Now you also wrote the same. :) Yes, that's

Re: [PATCH] Revert "initd: fix off-by-one error in mkdev.c"

2021-08-31 Thread Nick
Yep. Thanks. Just added another patch that is fixing the issue. I went to some internet sources and code to see how other people handle the issue and seems like everyone is just subtracting 1. Now you also wrote the same. :) Bests, Nick On 8/31/21 10:59 AM, Felix Fietkau wrote: On

Re: [PATCH] Revert "initd: fix off-by-one error in mkdev.c"

2021-08-31 Thread Felix Fietkau
On 2021-08-31 10:25, vinc...@systemli.org wrote: > From: Nick Hainke > > This reverts commit 8eb1d783cca6e0d501dd3a2f94262ffc36ae6482. > > This line reads a symbolic link into the string buffer "buf". > len = readlink(buf2, buf, sizeof(buf)); > The commit replaced now > buf[len] =

[PATCH] Revert "initd: fix off-by-one error in mkdev.c"

2021-08-31 Thread vincent
From: Nick Hainke This reverts commit 8eb1d783cca6e0d501dd3a2f94262ffc36ae6482. This line reads a symbolic link into the string buffer "buf". len = readlink(buf2, buf, sizeof(buf)); The commit replaced now buf[len] = 0; with buf[sizeof(buf) - 1] = '\0'; However, that