[PATCH] D54584: Add new interceptor for regex(3) in NetBSD
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 3 17:19:00 PST 2018
krytarowski marked 2 inline comments as done.
krytarowski added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7298
+ SIZE_T res = REAL(regerror)(errcode, preg, errbuf, errbuf_size);
+ if (errbuf)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, errbuf, REAL(strlen)(errbuf) + 1);
----------------
vitalybuka wrote:
> if REAL failed, string may be not null terminated, so strlen will crash
(At least the NetBSD version of) regerror(3) never fails and always returns a string where strlen(3) works.
Actually I can use its value as size to call COMMON_INTERCEPTOR_WRITE_RANGE().
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7315
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, sub, REAL(strlen)(sub) + 1);
+ // The implementation demands and hardcodes 10 elements
+ if (rm)
----------------
vitalybuka wrote:
> I can't find documentation for regnsub
http://netbsd.gw.com/cgi-bin/man-cgi?regnsub++NetBSD-current
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54584/new/
https://reviews.llvm.org/D54584
More information about the llvm-commits
mailing list