-
Notifications
You must be signed in to change notification settings - Fork 2k
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
mssql12 segfault with --fork #1076
Comments
I believe --fork has absolutely nothing to do with this problem. You seem to focus a whole lot on using fork with TS but it's just confusing and misleading. Formats are 100% unaffected by the fork option, only core and modes are affected by it. |
I can reproduce it with -fork or -node but not without it. This is more likely a bug in wordlist mode. (So yes I was wrong, and also right o.O) |
I started with --fork=3, got the segfault, re-tested without fork, and for me the error disappeared:
Then, I tested --fork=2, and reported the error. |
This hides the bug: diff --git a/src/mssql12_fmt_plug.c b/src/mssql12_fmt_plug.c
index 1f8a3e0..cb8969b 100644
--- a/src/mssql12_fmt_plug.c
+++ b/src/mssql12_fmt_plug.c
@@ -252,10 +252,13 @@ static char *get_key(int index)
ARCH_WORD_64 *keybuffer = saved_key[index];
UTF16 *w16 = (UTF16*)keybuffer;
static UTF16 out[PLAINTEXT_LENGTH + 1];
- unsigned int i, len;
+ int i, len;
len = ((keybuffer[15] >> 3) - SALT_SIZE) >> 1;
+ if (len < 0)
+ len = 0;
+
for(i = 0; i < len; i++)
out[i] = w16[i];
However, I think this is a bug in core that needs to be fixed instead. Either we call get_key() on an index where we never set the key, or we called clear_keys() and after that, called get_key() from status.c |
|
Sure enough, that is what happens. status.c calls get_key() after clear_keys() was called. This might be a somewhat tricky problem. |
I wonder if this is actually supposed to be supported. Maybe we should ask Solar. If this is supposed to be OK, the patch I posted is the definite fix. |
Still cores |
WhyTF do I not get a proper BT?
I would love to know frame 2. |
frame 2 was john.c line 1420... |
The text was updated successfully, but these errors were encountered: