bnoordhuis/node-buffertools — Issue #22: Segmentation fault in boyermoore_search
Author: QuinoBLN
Created: 2012-02-06 16:44:18+00:00
State: open

When searching a string in a buffer whose length is smaller than the length of the searched string, a segmentation fault error occurs in 'boyermoore_search'. To reproduce just run the following example:

var buffertools = require('buffertools');
var test = new Buffer('p');
var i = test.indexOf('asdfasdfasdfkasdj');

As workaround, I'm just checking the length of the buffer before using indexOf, but I'd have expected that indexOf makes this check itself.

Hope this is solved soon.
Thank you!