Changeset 449
- Timestamp:
- 03/30/06 01:50:14 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/y.tab.c
r437 r449 1618 1618 1619 1619 1620 #ifndef HAVE_STRNDUP 1621 // from http://www.unixpapa.com/incnote/string.html 1622 char *strndup(const char *str, size_t len) 1623 { 1624 char *dup= (char *)malloc( len+1 ); 1625 if (dup) { 1626 strncpy(dup,str,len); 1627 dup[len]= '\0'; 1628 } 1629 return dup; 1630 } 1631 #endif /* HAVE_STRNDUP */ 1632 1633 1620 1634 struct sc_shellcode *init_shellcode() 1621 1635 { … … 1630 1644 } 1631 1645 1646 int free_shellcode(struct sc_shellcode *s) 1647 { 1648 free(s->name); 1649 free(s->author); 1650 free(s->reference); 1651 free(s->pattern); 1652 return 0; 1653 } 1654 1655 int sc_free_shellcodes(struct sc_shellcode *s) 1656 { 1657 struct sc_shellcode *next = s; 1658 int i=0; 1659 while ((next = s->next) != NULL) 1660 { 1661 free_shellcode(s); 1662 s = next; 1663 i++; 1664 } 1665 return i; 1666 } 1632 1667 1633 1668 char *sc_get_namespace_by_numeric(int num)
