Coverity SECURE_CODING - CID 10860

Bug #957414 reported by Product Strategy Coverity Bug Uploader
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Application Menu Indicator
Fix Released
Low
Charles Kerr
0.4
Fix Released
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: 10860
Checker: SECURE_CODING
Category: No category available
CWE definition: http://cwe.mitre.org/data/definitions/676.html
File: /tmp/buildd/indicator-appmenu-0.3.94/src/hudstringlist.c
Function: hud_string_list_cons()
Code snippet:
117 headlen = strlen (head);
118
119 list = g_malloc (G_STRUCT_OFFSET (HudStringList, head) + headlen + 1);
120 list->tail = hud_string_list_ref (tail);
CID 10860 - 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.
121 strcpy (list->head, head);
122 list->ref_count = 1;
123
124 return list;
125 }
126

Related branches

Revision history for this message
Product Strategy Coverity Bug Uploader (coverity-uploader) wrote : indicator-appmenu-0.4: /tmp/buildd/indicator-appmenu-0.3.94/src/hudstringlist.c

Source file with Coverity annotations.

Changed in indicator-appmenu:
importance: Undecided → Medium
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.