Indicator Applet

Coverity SECURE_CODING - CID 10715

Reported by Product Strategy Coverity Bug Uploader on 2012-03-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Indicator Applet
Low
Charles Kerr
0.4
Low
Charles Kerr

Bug Description

This bug is exported from the Coverity Integration Manager on Canonical's servers. For information on how this is done please see this website: https://wiki.ubuntu.com/CanonicalProductStrategy/Coverity
CID: 10715
Checker: SECURE_CODING
Category: No category available
CWE definition: http://cwe.mitre.org/data/definitions/676.html
File: /tmp/buildd/indicator-applet-0.4.91/src/eggaccelerators.c
Function: egg_virtual_accelerator_name()
Code snippet:
399 l = 0;
400 accelerator[l] = 0;
401 if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
402 {
CID 10715 - SECURE_CODING
[VERY RISKY]. Using "strcpy" can cause a buffer overflow when done incorrectly. If the destination string of a strcpy() is not large enough then anything might happen. Use strncpy() instead.
403 strcpy (accelerator + l, text_release);
404 l += sizeof (text_release) - 1;
405 }
406 if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
407 {
CID 10715 - SECURE_CODING
[VERY RISKY]. Using "strcpy" can cause a buffer overflow when done incorrectly. If the destination string of a strcpy() is not large enough then anything might happen. Use strncpy() instead.
408 strcpy (accelerator + l, text_shift);

Ted Gould (ted) wrote :

Marking as low since the code actually allocates the data in the function and then uses it. Should be pretty safe.

Changed in indicator-applet:
status: New → Confirmed
importance: Medium → Low
Charles Kerr (charlesk) wrote :

I agree with Ted's assessment that it's a low priority.

Also, indicator-applet doesn't seem to have any test hooks, so confirming a patch would be a little work.

Happily, since the function generating these warnings is completely unused, we can silence the warnings and avoid the need for testing by just removing the function. :)

Changed in indicator-applet:
status: Confirmed → In Progress
assignee: nobody → charles (charlesk)
Charles Kerr (charlesk) wrote :
Changed in indicator-applet:
status: In Progress → Fix Committed
Ted Gould (ted) on 2012-03-09
Changed in indicator-applet:
status: Fix Committed → Fix Released
milestone: none → 0.4.92
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers