Skip to content

Commit

Permalink
Fix security issues from code scan (facebookincubator#10558)
Browse files Browse the repository at this point in the history
Summary:
Through a static security scan two types of issues came up that were classified as high severity.

1. Target Blank Vulnerability
2. Macro replacement lists should be parenthesized

This code changes addresses some of the found locations. While these in their current usage do pose problems it is easy to fix them regardless.

Pull Request resolved: facebookincubator#10558

Reviewed By: kevinwilfong

Differential Revision: D60244318

Pulled By: Yuhta

fbshipit-source-id: cff8adf8a6e233c8e41c4574c4ed0176fa9aae2d
  • Loading branch information
czentgr authored and facebook-github-bot committed Jul 26, 2024
1 parent b5713ef commit 237ff41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions velox/dwio/parquet/writer/arrow/util/safe-math.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#define PSNIP_SAFE_LIKELY(expr) __builtin_expect(!!(expr), 1)
#define PSNIP_SAFE_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
#else
#define PSNIP_SAFE_LIKELY(expr) !!(expr)
#define PSNIP_SAFE_UNLIKELY(expr) !!(expr)
#define PSNIP_SAFE_LIKELY(expr) (!!(expr))
#define PSNIP_SAFE_UNLIKELY(expr) (!!(expr))
#endif /* defined(__GNUC__) */

#if !defined(PSNIP_SAFE_STATIC_INLINE)
Expand Down Expand Up @@ -1332,11 +1332,11 @@ PSNIP_SAFE_DEFINE_UNSIGNED_MOD(psnip_uint64_t, uint64, 0xffffffffffffffffULL)
PSNIP_SAFE_C11_GENERIC_SELECTION(res, op)(res, v)

#if defined(PSNIP_SAFE_HAVE_BUILTIN_OVERFLOW)
#define psnip_safe_add(res, a, b) !__builtin_add_overflow(a, b, res)
#define psnip_safe_sub(res, a, b) !__builtin_sub_overflow(a, b, res)
#define psnip_safe_mul(res, a, b) !__builtin_mul_overflow(a, b, res)
#define psnip_safe_div(res, a, b) !__builtin_div_overflow(a, b, res)
#define psnip_safe_mod(res, a, b) !__builtin_mod_overflow(a, b, res)
#define psnip_safe_add(res, a, b) (!__builtin_add_overflow(a, b, res))
#define psnip_safe_sub(res, a, b) (!__builtin_sub_overflow(a, b, res))
#define psnip_safe_mul(res, a, b) (!__builtin_mul_overflow(a, b, res))
#define psnip_safe_div(res, a, b) (!__builtin_div_overflow(a, b, res))
#define psnip_safe_mod(res, a, b) (!__builtin_mod_overflow(a, b, res))
#define psnip_safe_neg(res, v) PSNIP_SAFE_C11_GENERIC_UNARY_OP(neg, res, v)

#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
Expand Down
10 changes: 5 additions & 5 deletions velox/external/utf8proc/utf8proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ typedef enum {
*/
/** @{ */
/** Memory could not be allocated. */
#define UTF8PROC_ERROR_NOMEM -1
#define UTF8PROC_ERROR_NOMEM (-1)
/** The given string is too long to be processed. */
#define UTF8PROC_ERROR_OVERFLOW -2
#define UTF8PROC_ERROR_OVERFLOW (-2)
/** The given string is not a legal UTF-8 string. */
#define UTF8PROC_ERROR_INVALIDUTF8 -3
#define UTF8PROC_ERROR_INVALIDUTF8 (-3)
/** The @ref UTF8PROC_REJECTNA flag was set and an unassigned codepoint was
* found. */
#define UTF8PROC_ERROR_NOTASSIGNED -4
#define UTF8PROC_ERROR_NOTASSIGNED (-4)
/** Invalid options have been used. */
#define UTF8PROC_ERROR_INVALIDOPTS -5
#define UTF8PROC_ERROR_INVALIDOPTS (-5)
/** @} */

/* @name Types */
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/VeloxConBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function VeloxConBanner() {
<h2>See the VeloxCon 2024 Recordings</h2>
</div>
<div className="col col--3">
<a className="button button--info button--lg" href="https://www.youtube.com/playlist?list=PLJvBe8nQAEsEBSoUY0lRFVZr2_YeHYkUR" target="_blank">Watch</a>
<a className="button button--info button--lg" href="https://www.youtube.com/playlist?list=PLJvBe8nQAEsEBSoUY0lRFVZr2_YeHYkUR" target="_blank" rel="noopener noreferrer">Watch</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 237ff41

Please sign in to comment.