Page MenuHomePhabricator

eio: fix a potentional BOF problem
ClosedPublic

Authored by akanad on Feb 12 2019, 10:39 PM.

Details

Summary

if length of path arguments are longer than PATH_MAX,
there could be a BOF problem potentionally.
this patch fixes it.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
akanad created this revision.Feb 12 2019, 10:39 PM
akanad requested review of this revision.Feb 12 2019, 10:39 PM
cedric requested changes to this revision.Feb 13 2019, 9:07 AM

Hum, I see the problem in the opposite way. Some OS do not have this PATH_MAX limit and we should not enforce it in our code like that. I would prefer that we remove all reference of PATH_MAX in eio_dir.c and use eina_strbuf instead for example.

This revision now requires changes to proceed.Feb 13 2019, 9:07 AM
akanad updated this revision to Diff 19467.Feb 20 2019, 5:38 PM

@cedric did you mean a way like this?

akanad updated this revision to Diff 19468.Feb 20 2019, 6:07 PM

little fix

cedric requested changes to this revision.Feb 20 2019, 6:56 PM

Pretty much. Just one more change and it will be good to go.

src/lib/eio/eio_dir.c
323

This start to be duplicated with the on_error exit label. Could you merge them?

This revision now requires changes to proceed.Feb 20 2019, 6:56 PM
akanad updated this revision to Diff 19472.Feb 20 2019, 8:05 PM

remove duplicated one

cedric accepted this revision.Feb 21 2019, 9:47 AM
This revision is now accepted and ready to land.Feb 21 2019, 9:47 AM
This revision was automatically updated to reflect the committed changes.