Changeset 449

Show
Ignore:
Timestamp:
03/30/06 01:50:14 (3 years ago)
Author:
common
Message:

shellcode-signatures
- the new y.tab.c files including the strndup helper and the shellcode free functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/y.tab.c

    r437 r449  
    16181618 
    16191619 
     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 
    16201634struct sc_shellcode *init_shellcode() 
    16211635{ 
     
    16301644} 
    16311645 
     1646int 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 
     1655int 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} 
    16321667 
    16331668char *sc_get_namespace_by_numeric(int num)