Browse Source

Fix uninitialized return value in MTP module

The rc variable in the get_file function in the libmtp-based
module was not initialized, leading to a random return code when
no MTP device is present. This could lead to a crash if the
returned value happened to be zero, which is interpreted as a
success by the calling code (which then assumes that the share
has been successfully retrieved).
master
Damien Goutte-Gattat 5 years ago
parent
commit
8e57480434
  1. 2
      src/scheme-libmtp.c

2
src/scheme-libmtp.c

@ -277,7 +277,7 @@ gfsec_scheme_libmtp_get_file(gfsec_scheme_t scheme,
{
LIBMTP_mtpdevice_t *device;
struct getfile_cb_data cb_data;
int rc;
int rc = GFSEC_SCHEME_STATUS_ERROR;
if ( scheme != GFSEC_SCHEME_MTP )
return GFSEC_SCHEME_STATUS_UNSUPPORTED_SCHEME;

Loading…
Cancel
Save