patch-src_output-plugins_spo_alert_unixsock_c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --- snort-2.8.5.1.orig/src/output-plugins/spo_alert_unixsock.c 2009-05-07 00:29:12.000000000 +0200
  2. +++ snort-2.8.5.1/src/output-plugins/spo_alert_unixsock.c 2009-12-27 17:23:19.000000000 +0100
  3. @@ -176,16 +176,16 @@ void AlertUnixSock(Packet *p, char *msg,
  4. DEBUG_WRAP(DebugMessage(DEBUG_LOG, "Logging Alert data!\n"););
  5. - bzero((char *)&alertpkt,sizeof(alertpkt));
  6. + memset((char *)&alertpkt, 0, sizeof(alertpkt));
  7. if (event)
  8. {
  9. - bcopy((const void *)event,(void *)&alertpkt.event,sizeof(Event));
  10. + memcpy((void *)&alertpkt.event,(const void *)event,sizeof(Event));
  11. }
  12. if(p && p->pkt)
  13. {
  14. - bcopy((const void *)p->pkth,(void *)&alertpkt.pkth,sizeof(struct pcap_pkthdr));
  15. - bcopy((const void *)p->pkt,alertpkt.pkt,
  16. + memcpy((void *)&alertpkt.pkth,(const void *)p->pkth,sizeof(struct pcap_pkthdr));
  17. + memcpy(alertpkt.pkt,(const void *)p->pkt,
  18. alertpkt.pkth.caplen > SNAPLEN? SNAPLEN : alertpkt.pkth.caplen);
  19. }
  20. else
  21. @@ -193,7 +193,7 @@ void AlertUnixSock(Packet *p, char *msg,
  22. if (msg)
  23. {
  24. - bcopy((const void *)msg,(void *)alertpkt.alertmsg,
  25. + memcpy((void *)alertpkt.alertmsg,(const void *)msg,
  26. strlen(msg)>ALERTMSG_LENGTH-1 ? ALERTMSG_LENGTH - 1 : strlen(msg));
  27. }
  28. @@ -236,7 +236,7 @@ void AlertUnixSock(Packet *p, char *msg,
  29. break;
  30. default:
  31. - /* alertpkt.transhdr is null due to initial bzero */
  32. + /* alertpkt.transhdr is null due to initial memset */
  33. alertpkt.val|=NO_TRANSHDR;
  34. break;
  35. }
  36. @@ -282,7 +282,7 @@ void OpenAlertSock(void)
  37. srv);
  38. }
  39. - bzero((char *) &alertaddr, sizeof(alertaddr));
  40. + memset((char *) &alertaddr, 0, sizeof(alertaddr));
  41. /* 108 is the size of sun_path */
  42. strncpy(alertaddr.sun_path, srv, 108);