openbmc/phosphor-ipmi-blobs-binarystore

Don't use the 'size' value read from sysfile if it's too large

kunyi731 opened this issue · 0 comments

In https://github.com/openbmc/phosphor-ipmi-blobs-binarystore/blob/master/binarystore.cpp#L70, if there were no persistent blobs, the 'size' variable read could be junk. Constructing a string using size larger than string::max_len raises an exception. Should validate first.