iconv: Fix copy-paste error checking wrong iconv descriptor

After opening the fromfs iconv descriptor, the error check on line 725
tests ic->tofs (already verified above) instead of ic->fromfs. A failed
iconv_open for the fromfs direction is silently ignored, leaving an
invalid descriptor that causes undefined behavior in iconv_convpath.

Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
This commit is contained in:
Abhinav Agarwal
2026-04-15 11:58:03 -07:00
committed by Bernd Schubert
parent efa6c4c8be
commit ee093d226c
+1 -1
View File
@@ -722,7 +722,7 @@ static struct fuse_fs *iconv_new(struct fuse_args *args,
goto out_free;
}
ic->fromfs = iconv_open(to, from);
if (ic->tofs == (iconv_t) -1) {
if (ic->fromfs == (iconv_t) -1) {
fuse_log(FUSE_LOG_ERR, "fuse-iconv: cannot convert from %s to %s\n",
from, to);
goto out_iconv_close_to;