Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more libc filenames #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion fuzzowski/helpers/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from functools import reduce
from itertools import groupby
import ctypes
import ctypes.util
import errno
import os
import platform
Expand Down Expand Up @@ -142,7 +143,16 @@ def get_max_udp_size():
if mac:
lib = ctypes.cdll.LoadLibrary('libc.dylib')
elif linux:
lib = ctypes.cdll.LoadLibrary('libc.so.6')
libc_paths = ('libc.so.6', 'libc.so', 'libc.a',
ctypes.util.find_library('c'))
for libc_path in libc_paths:
try:
lib = ctypes.cdll.LoadLibrary(libc_path)
break
except (IOError, OSError):
continue
if not lib:
raise Error("Unable to locate libc")
sol_socket = ctypes.c_int(socket.SOL_SOCKET)
opt = ctypes.c_int(socket.SO_SNDBUF)

Expand Down