thewh1teagle / rookie

Load cookies from your web browsers
https://crates.io/crates/rookie
MIT License
207 stars 18 forks source link

[Bug]: Panic with chrome 'range end index 3 out of range for slice of length 0' #25

Closed AltarBeastiful closed 7 months ago

AltarBeastiful commented 8 months ago

What happened?

Got a stacktrace on Windows 10 with chrome Version 123.0.6312.58. Only if I'm getting cookies without a list of domains: PanicException: range end index 3 out of range for slice of length 0

Works when setting a domain list and works on Firefox and Edge without domains.

Steps to reproduce

  1. Run any load function for chrome with no parameters rookiepy.chrome()

What browsers are you seeing the problem on?

Chrome

Relevant log output

DEBUG:rookie.common.paths:Found mozilla path C:\Users\X243276\AppData\Roaming\Mozilla\Firefox\Profiles/qf1j0fau.default-release\cookies.sqlite
DEBUG:rookie.common.paths:Found chrome path C:\Users\X243276\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies, C:\Users\X243276\AppData\Local\Microsoft\Edge\User Data\Default\Network\../../Local State
WARNING:rookie.browser.chromium:Unlocking chrome database, it may take a while (sometimes up to minute)
INFO:rookie.browser.chromium:Creating sqlite connection to C:\Users\X243276\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies
DEBUG:rookie.common.paths:Found chrome path C:\Users\X243276\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies, C:\Users\X243276\AppData\Local\Google\Chrome\User Data\Default\Network\../../Local State
WARNING:rookie.browser.chromium:Unlocking chrome database, it may take a while (sometimes up to minute)
INFO:rookie.browser.chromium:Creating sqlite connection to C:\Users\X243276\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies
thread '<unnamed>' panicked at rookie-rs\src\browser\chromium.rs:98:36:
range end index 3 out of range for slice of length 0
stack backtrace:
   0:     0x7ffdc0d00c3a - PyInit_rookiepy
   1:     0x7ffdc0d12f9b - PyInit_rookiepy
   2:     0x7ffdc0cfd991 - PyInit_rookiepy
   3:     0x7ffdc0d009ba - PyInit_rookiepy
   4:     0x7ffdc0d02d2a - PyInit_rookiepy
   5:     0x7ffdc0d02998 - PyInit_rookiepy
   6:     0x7ffdc0d033d8 - PyInit_rookiepy
   7:     0x7ffdc0d032bd - PyInit_rookiepy
   8:     0x7ffdc0d01629 - PyInit_rookiepy
   9:     0x7ffdc0d02fd0 - PyInit_rookiepy
  10:     0x7ffdc0eb2487 - PyInit_rookiepy
  11:     0x7ffdc0eb2a04 - PyInit_rookiepy
  12:     0x7ffdc0bdd231 - PyInit_rookiepy
  13:     0x7ffdc0bd8f80 - PyInit_rookiepy
  14:     0x7ffdc0bd9a12 - PyInit_rookiepy
  15:     0x7ffdc0bc4c82 - <unknown>
  16:     0x7ffdc0bc60f9 - <unknown>
  17:     0x7ffdc0bc1274 - <unknown>
  18:     0x7ffdc0bc4b80 - <unknown>
  19:     0x7ffdbe4a6cec - PyUnicode_RichCompare
  20:     0x7ffdbe45910b - PyObject_Vectorcall
  21:     0x7ffdbe45a544 - PyEval_EvalFrameDefault
  22:     0x7ffdbe46fa77 - PyMapping_Check
  23:     0x7ffdbe46f137 - PyEval_EvalCode
  24:     0x7ffdbe46d80a - PyMapping_Items
  25:     0x7ffdbe46d786 - PyMapping_Items
  26:     0x7ffdbe5ba17e - PyThread_tss_is_created
  27:     0x7ffdbe4233a5 - PyRun_SimpleFileObject
  28:     0x7ffdbe51a620 - PyRun_AnyFileObject
  29:     0x7ffdbe51aaef - Py_MakePendingCalls
  30:     0x7ffdbe51ab5f - Py_MakePendingCalls
  31:     0x7ffdbe51b964 - Py_RunMain
  32:     0x7ffdbe51b7f5 - Py_RunMain
  33:     0x7ffdbe4660d9 - Py_Main
  34:     0x7ff6a5ce1230 - <unknown>
  35:     0x7ffe22847344 - <unknown>
  36:     0x7ffe231e26b1 - RtlUserThreadStart
Traceback (most recent call last):
  File "C:\Users\X243276\projects\viviane-core\admin-sdk\cookies.py", line 99, in <module>
    cookies = rookiepy.load()
              ^^^^^^^^^^^^^^^
pyo3_runtime.PanicException: range end index 3 out of range for slice of length 0
thewh1teagle commented 7 months ago

Fixed in https://github.com/thewh1teagle/rookie/commit/72bd56c446ddb0082293e0586626f54dc545fae2 Thanks for reporting!