function declaration from comments mismatch in mosquitto_plugin.h

Bug #1075395 reported by sskaje
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mosquitto
Fix Released
Undecided
Unassigned

Bug Description

I wrote a auth plugin starting from your test plugin coded in C and i found something may be wrong in your code.

1)
in mosquitto_plugin.h:

int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count);

and other functions such as

int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count);

first one has void **user_data and others void *userdata. Is this right?

2)
in your test code test/broker/c/auth_plugin.c

int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt **auth_opts, int auth_opt_count)
int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt **auth_opts, int auth_opt_count)
int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt **auth_opts, int auth_opt_count, bool reload)
int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt **auth_opts, int auth_opt_count, bool reload)

struct mosquitto_auth_opt **auth_opts
should be
struct mosquitto_auth_opt *auth_opts

sskaje (sskaje)
Changed in mosquitto:
status: New → Invalid
status: Invalid → Opinion
status: Opinion → New
Revision history for this message
Roger Light (roger.light) wrote :

I agree that this is incorrect. It only works because the argument isn't referred to at all. I have committed a fix: https://bitbucket.org/oojah/mosquitto/changeset/1d54675434a77f3e2308bd5d834f59d0d942be94

Thanks for the report!

Changed in mosquitto:
status: New → Fix Committed
Changed in mosquitto:
milestone: none → 1.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.