Summary: | telepathy-salut-0.5.0 build failure: error: 'attr' may be used uninitialized in this function [-Wuninitialized] | ||
---|---|---|---|
Product: | Wocky | Reporter: | Ed Catmur <ed> |
Component: | General | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | freedesktop-bugs, will |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
wocky-uninitialized.patch
SCRAM: correct logic in server-final message handling |
Description
Ed Catmur
2011-05-28 14:31:48 UTC
Created attachment 47259 [details] [review] wocky-uninitialized.patch Fix uninitialised variable. Might I also request that you bump the minor on wocky or otherwise disable -Werror by default on release tarballs? Thanks for the report! Actually, the correct fix is not to initialize the variable, but to change the conditional to use || not &&. Patch with explanation to follow, and reassigning to Wocky. I believe that, these days, Wocky as bundled with Salut no longer sets -Werror. Created attachment 64543 [details] [review] SCRAM: correct logic in server-final message handling The server-final message looks like this: server-final-message = (server-error / verifier) ["," extensions] server-error = "e=" server-error-value verifier = "v=" base64 The code was trying to check “is there at least one attribute, and is it a verifier?”. But instead it was checking “is there at least one attribute, and if not, is the non-existant attribute a verifier?” by comparing the uninitialized 'attr' variable to 'v'. I've checked other calls to scram_get_next_attr_value() and they seem to get the logic the right way round. This bug does not cause a security vulnerability. If the uninitialized 'attr' variable happens to contain the character 'v', then the following call to scram_check_server_verification() will compare the contents of value (which ought to be a verification string, but is NULL) to the verification string as calculated by Wocky (which is not NULL) and so Wocky will abort the connection. Thanks to Ed Catmur for reporting the use of an uninitialized variable on <https://bugs.freedesktop.org/show_bug.cgi?id=37701>. Comment on attachment 64543 [details] [review] SCRAM: correct logic in server-final message handling Review of attachment 64543 [details] [review]: ----------------------------------------------------------------- ""# m # mmmm mm#mm mmmmm # #" "# # # # # # # # # # # # "mm "#m"# "mm # # # m # "" I've merged this to Wocky master. I'll leave it to someone else to update the Wocky snapshots in Salut and Gabble. The fix will be in Salut 0.9.0 whenever that is released! http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=4159cf378f26e8cd17d875667c68a3446e084acd |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.