You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typedef struct _XMLNode {
char* tag; /* Tag name */
} XMLNode;
int XML_parse_1string(char* str, XMLNode* xmlnode)
{
int n ,tag_end = 0;
n = 1+tag_end;
xmlnode->tag = (char*)malloc(n - tag_end);
if (xmlnode->tag == NULL) return 0;
strncpy(xmlnode->tag, str+1+tag_end, n-1-tag_end); //it is not a weakness
return 0;
}
this example result a weakness which is "Size argument is greater than the length of the destination buffer", but really it is not a weakness