#3851 SBUS: Silence warning maybe-uninitialized
Merged 5 years ago by jhrozek. Opened 5 years ago by lslebodn.
SSSD/ lslebodn/sssd p11_child_uninit  into  master

@@ -355,6 +355,8 @@ 

      case SBUS_PROPERTY_WRITABLE:

          type = SBUS_REQUEST_PROPERTY_SET;

          break;

+     default:

+         return EINVAL;

      }

  

      sbus_req = sbus_request_create(mem_ctx, conn, type, destination,

It should not happen because function sbus_interface_find_property
should return NULL for access different than SBUS_PROPERTY_READABLE
or SBUS_PROPERTY_WRITABLE. And thus we would return ERR_SBUS_UNKNOWN_PROPERTY
from the function sbus_request_property.

src/sbus/interface/sbus_properties.c: In function 'sbus_request_property.isra.0':
src/sbus/interface/sbus_properties.c:360:14:
error: 'type' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
sbus_req = sbus_request_create(mem_ctx, conn, type, destination,
~^
interface_name, property_name, path);
~~
cc1: all warnings being treated as errors

rebased onto c8e9c76

5 years ago

rebased onto c8e9c76

5 years ago

Commit d143319 fixes this pull-request

Pull-Request has been merged by jhrozek

5 years ago
Metadata