Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed sigabrt on 32bit ubuntu 11.10 #14

Merged
merged 1 commit into from

2 participants

Jakub Lekstan Peteris Krumins
Jakub Lekstan

So I found a problem using this library on 32bit Ubuntu 11.10, I was getting SIGABRT while I was trying to:

require('base64').encode('000000000000');

Here is more detailed log: https://gist.github.com/1685186
GDB pointed me to this: https://gist.github.com/1685242

So I rewrited a little the code which was responsible for handling the string given from javascript.

Peteris Krumins pkrumins merged commit 8a7e792 into from
Jakub Lekstan

Can you please update npm version too?

Peteris Krumins
Owner

done

Jakub Lekstan

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 26, 2012
  1. Jakub Lekstan
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 5 deletions.
  1. +2 −5 base64.cc
7 base64.cc
View
@@ -135,11 +135,8 @@ base64_encode_binding(const Arguments &args)
);
}
else if (args[0]->IsString()) {
- Local<String> v8str = args[0]->ToString();
- char * buffer = (char *) malloc(v8str->Utf8Length());
- v8str->WriteUtf8(buffer);
- str = base64_encode((unsigned char *)buffer, strlen(buffer));
- free(buffer);
+ String::Utf8Value v8str (args[0]->ToString());
+ str = base64_encode((unsigned char *) *v8str, v8str.length());
}
else
return VException("Argument should be a buffer or a string");
Something went wrong with that request. Please try again.