[packagekit] pk-backend-status crash

Richard Hughes hughsient at gmail.com
Sat Nov 17 02:55:33 PST 2007


On Fri, 2007-11-16 at 17:30 -0700, Scott Reeves wrote:
> pk-backend-status segfaults if the dbus GetBackendDetail call returns errors.

GetBackendDetail should be provided by every backend... it's pretty
trivial.

> The attached patch fixes the error.

Well, comments about that (I'm a fussy git):

        /* general stuff */
-       pk_client_get_backend_detail (client, &name, &author);
+       if(!pk_client_get_backend_detail (client, &name, &author))
+       {
+               pk_warning (_("Exiting on failure\n"));
+               return 1;
+       }

I would write this:

ret = pk_client_get_backend_detail (client, &name, &author);
if (ret == FALSE) {
	pk_warning ("backend does not provide details");
	return 1;
}

Notice the tabs and ret? The ret is compiled away by the compiler and is
a lot easier to code review. Can you correct your patch and commit
please. Thanks.

Richard.




More information about the PackageKit mailing list