mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
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:
committed by
Bernd Schubert
parent
efa6c4c8be
commit
ee093d226c
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user