Commit 08529723 authored by Damian Johnson's avatar Damian Johnson
Browse files

Accounting for NULL access by ctypes

Evidently accessing argc can raise a ValueError...

https://trac.torproject.org/8266
parent 1a099106
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -722,8 +722,16 @@ def get_process_name():
      args, argc = [], argc_t()

      for i in xrange(100):
        # The ending index can be either None or raise a ValueError when
        # accessed...
        #
        # ValueError: NULL pointer access

        try:
          if argc[i] is None:
            break
        except ValueError:
          break

        args.append(str(argc[i]))