Skip to content

Commit

Permalink
Patch from agmiklas for NULL termination bug in ACL translation. Than…
Browse files Browse the repository at this point in the history
…ks\!
  • Loading branch information
wickman committed Jul 20, 2010
1 parent 60249ff commit 93b6936
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
*~
*.log
Makefile
pkg
2 changes: 2 additions & 0 deletions ext/zookeeper_lib.c
Expand Up @@ -435,13 +435,15 @@ struct Id zkrb_ruby_to_id(VALUE rubyid) {
if (scheme != Qnil) {
id.scheme = malloc(RSTRING(scheme)->len + 1);
strncpy(id.scheme, RSTRING(scheme)->ptr, RSTRING(scheme)->len);
id.scheme[RSTRING(scheme)->len] = '\0';
} else {
id.scheme = NULL;
}

if (ident != Qnil) {
id.id = malloc(RSTRING(ident)->len + 1);
strncpy(id.id, RSTRING(ident)->ptr, RSTRING(ident)->len);
id.id[RSTRING(ident)->len] = '\0';
} else {
id.id = NULL;
}
Expand Down

0 comments on commit 93b6936

Please sign in to comment.