QueryParser: Equation::Match(): Fix generic attribute case
Init size to the buffer size before passing it to QueryPolicy::NodeGetAttribute(). Since size was 0 by default, we would only read 0 length data.
This commit is contained in:
parent
d055934e36
commit
10e9f49914
|
@ -708,6 +708,7 @@ Equation<QueryPolicy>::Match(Entry* entry, Node* node,
|
|||
// get a pointer to the attribute in question
|
||||
union value<QueryPolicy> value;
|
||||
uint8* buffer = (uint8*)&value;
|
||||
const size_t bufferSize = sizeof(value);
|
||||
|
||||
// first, check if we are matching for a live query and use that value
|
||||
if (attributeName != NULL && !strcmp(fAttribute, attributeName)) {
|
||||
|
@ -737,6 +738,7 @@ Equation<QueryPolicy>::Match(Entry* entry, Node* node,
|
|||
type = B_INT32_TYPE;
|
||||
} else {
|
||||
// then for attributes
|
||||
size = bufferSize;
|
||||
if (QueryPolicy::NodeGetAttribute(node, fAttribute, buffer, &size,
|
||||
&type) != B_OK) {
|
||||
return MatchEmptyString();
|
||||
|
|
Loading…
Reference in New Issue