GNOME Bugzilla – Bug 729267
Build failure: mm-modem-messaging.c:168:24: error: 'array' may be used uninitialized in this function
Last modified: 2014-05-05 18:51:36 UTC
When building ModemManager with -O3, you get the following failure: mm-modem-messaging.c: In function 'mm_modem_messaging_get_supported_storages': mm-modem-messaging.c:168:24: error: 'array' may be used uninitialized in this function [-Werror=maybe-uninitialized] *n_storages = array->len; ^ cc1: all warnings being treated as errors make[3]: *** [libmm_glib_la-mm-modem-messaging.lo] Error 1 That function does: GArray *array; [...] ensure_internal_supported_storages (self, &array); if (!array) return FALSE; *n_storages = array->len; and ensure_internal_supported_storages() does if (dup && self->priv->supported_storages) *dup = g_array_ref (self->priv->supported_storages); So nowhere array gets initialized to NULL. So this is indeed a potential crasher if it gets init'ed to some garbage and then ensure_internal_supported_storages() tries to write into it.
Created attachment 275490 [details] [review] Simple fix git-formatted patch against current master.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.