[CVE-2012-5667] grep: change some int types. 44/294544/1 accepted/tizen_6.0_base accepted/tizen_6.0_base_tool tizen_6.0_base accepted/tizen/6.0/base/20230713.143136 accepted/tizen/6.0/base/tool/20230625.221418 submit/tizen_6.0_base/20230622.061802
authorJinWang An <jinwang.an@samsung.com>
Wed, 21 Jun 2023 05:09:37 +0000 (14:09 +0900)
committerJinWang An <jinwang.an@samsung.com>
Wed, 21 Jun 2023 05:14:23 +0000 (14:14 +0900)
commit5b414d70958d46f22ceb5cccffee30268ea27a09
treea65f2e3726f23aba1c2467638ac4622a61604f41
parent5507a650f71cacb5b6163029b4d2e76209dce7cf
[CVE-2012-5667] grep: change some int types.

Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.

This is based on NetBSD's revision which says:

This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.

Obtained from: NetBSD
MFC after: 3 days

Change-Id: Iab3df8be93fa6d6725581410b1183e075002964b
Signed-off-by: JinWang An <jinwang.an@samsung.com>
dfa.c