ioctl: don't set outbufsz when not needed

This commit is contained in:
Antonio SJ Musumeci 2019-03-20 10:18:55 -04:00
parent 2ca0cb0fbf
commit b69819e4b2
4 changed files with 22 additions and 16 deletions

View file

@ -90,7 +90,8 @@ namespace l
case FS_IOC_SETVERSION:
if(endian::is_big() && (sizeof(long) != sizeof(int)))
return -ENOTTY;
*out_bufsz_ = 4;
if((data_ != NULL) && (*out_bufsz_ > 4))
*out_bufsz_ = 4;
break;
}