patch-src_output-plugins_spo_alert_unixsock_c 1.2 KB

12345678910111213141516171819202122232425262728
  1. --- snort-2.8.5.2.orig/src/output-plugins/spo_alert_unixsock.c 2009-05-07 00:29:12.000000000 +0200
  2. +++ snort-2.8.5.2/src/output-plugins/spo_alert_unixsock.c 2010-01-19 20:05:44.000000000 +0100
  3. @@ -179,13 +179,13 @@ void AlertUnixSock(Packet *p, char *msg,
  4. bzero((char *)&alertpkt,sizeof(alertpkt));
  5. if (event)
  6. {
  7. - bcopy((const void *)event,(void *)&alertpkt.event,sizeof(Event));
  8. + memcpy((void *)&alertpkt.event,(const void *)event,sizeof(Event));
  9. }
  10. if(p && p->pkt)
  11. {
  12. - bcopy((const void *)p->pkth,(void *)&alertpkt.pkth,sizeof(struct pcap_pkthdr));
  13. - bcopy((const void *)p->pkt,alertpkt.pkt,
  14. + memcpy((void *)&alertpkt.pkth,(const void *)p->pkth,sizeof(struct pcap_pkthdr));
  15. + memcpy(alertpkt.pkt,(const void *)p->pkt,
  16. alertpkt.pkth.caplen > SNAPLEN? SNAPLEN : alertpkt.pkth.caplen);
  17. }
  18. else
  19. @@ -193,7 +193,7 @@ void AlertUnixSock(Packet *p, char *msg,
  20. if (msg)
  21. {
  22. - bcopy((const void *)msg,(void *)alertpkt.alertmsg,
  23. + memcpy((void *)alertpkt.alertmsg,(const void *)msg,
  24. strlen(msg)>ALERTMSG_LENGTH-1 ? ALERTMSG_LENGTH - 1 : strlen(msg));
  25. }