mkdev: Avoid out of bounds read
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 2 Sep 2019 19:26:18 +0000 (21:26 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 20 Sep 2019 19:34:32 +0000 (21:34 +0200)
commit4327ed40d96c95803b2d4d09ddf997c895eea071
treefb8d660d73dbc07837e3837edd3ca4579fc5a983
parent9b3eb63d686b6d97a537f30b3bb6e29a7dec32a8
mkdev: Avoid out of bounds read

readlink() truncates and does not null terminate the string when more
bytes would be written than available. Just increase the char array by
one and assume that there is a problem when all bytes are needed.

Coverity: #1330087, #1329991
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
libblkid-tiny/mkdev.c