[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Strange build failure in libbsd



Hello,

Guillem Jover, le mer. 24 août 2022 12:42:28 +0200, a ecrit:
>  	res = memmem(altstack, ALTSTACK_SIZE, buf, sizeof(buf));

One thing I noticed there is that on failure, "res" it not equal to
buf, so something it copying the buffer, thus no wonder why
count_secrets finds it.

And it happens that read() does get what it reads on the stack: when the
__io_read() RPC gets small enough data to fit inline, it's copied on the
stack along the message before getting copied into the buffer.

So perhaps you should make replace memmem (that looks for the first
occurrence) with something that looks for the last occurrence, to really
get the buffer, and not some spurious copy performed by populate_secret?

Samuel


Reply to: