]> granicus.if.org Git - libevent/commit
Fix data-race in ws code (#1360)
authorAzat Khuzhin <azat@libevent.org>
Sat, 22 Oct 2022 20:23:52 +0000 (22:23 +0200)
committerAzat Khuzhin <azat@libevent.org>
Sat, 22 Oct 2022 20:24:40 +0000 (22:24 +0200)
commitf04a70f0fc5e3561538b0eff302defef9046c617
tree895fee5b8d158278a338b342b722c5c123cddfa1
parent8f47d8de281b877450474734594fdc0a60ee35d1
parente8f5a61d6d08169adcb7ee73f50963b97d433ed5
Fix data-race in ws code (#1360)

@widgetii:

  "
  =================================================================
  ==985==ERROR: AddressSanitizer: heap-use-after-free on address 0xb24323e5 at pc 0xb6a06f1c bp 0x9fffc694 sp 0x9fffc260
  WRITE of size 2 at 0xb24323e5 thread T22
      #0 0xb6a06f1b in __interceptor_memcpy.part.43 (/usr/lib/libasan.so.5+0x41f1b)

  0xb24323e5 is located 229 bytes inside of 512-byte region [0xb2432300,0xb2432500)
  freed by thread T0 (app) here:
      #0 0xb6a849df in free (/usr/lib/libasan.so.5+0xbf9df)
      #1 0xb64b6e07 in evbuffer_drain (/usr/lib/libevent_core-2.2.so.1+0x9e07)

  previously allocated by thread T22 here:
      #0 0xb6a84d17 in __interceptor_malloc (/usr/lib/libasan.so.5+0xbfd17)
      #1 0xb64b3d1b  (/usr/lib/libevent_core-2.2.so.1+0x6d1b)
      #2 0x61223 in onIceCandidateHandler /home/dima/git/app/src/webrtc/local.c:116
      #3 0x19296f in onNewIceLocalCandidate /home/dima/git/webrtc-c/src/source/PeerConnection/PeerConnection.c:471
  "

* upstream/pr/1360:
  Remove bad copy-paste
  Add locks for server WS, fixes #1357