tensorflow/third_party/gif.BUILD
Penporn Koanantakool 8b330d28a0 Rollforward of PR #32169: Upgrading giflib to fix CVE-2019-15133
Add a patch file to fix giflib's compilation issue on Windows (replace a call to strtok_r with strtok_s).

# CVE-2019-15133

**NVD**: 2019/08/17 - CVSS v2.0 Base Score: 4.3 - CVSS v3.0 Base Score: 6.5
In GIFLIB before 2019-02-16, a malformed GIF file triggers a divide-by-zero exception in the decoder function DGifSlurp in dgif_lib.c if the height field of the ImageSize data structure is equal to zero.

## **References to Advisories, Solutions, and Tools**

Source | Link | Type
---- | ---- | ----
MISC | bugs.chromium.org | Mailing List, Third Party Advisory
UBUNTU | usn.ubuntu.com | Third Party Advisory

PiperOrigin-RevId: 267533902
2019-09-05 23:39:58 -07:00

62 lines
1.2 KiB
Plaintext

# Description:
# A library for decoding and encoding GIF images
licenses(["notice"]) # MIT
exports_files(["COPYING"])
cc_library(
name = "gif",
srcs = [
"dgif_lib.c",
"egif_lib.c",
"gif_err.c",
"gif_font.c",
"gif_hash.c",
"gif_hash.h",
"gif_lib_private.h",
"gifalloc.c",
"openbsd-reallocarray.c",
"quantize.c",
],
hdrs = ["gif_lib.h"],
defines = select({
":android": [
"S_IREAD=S_IRUSR",
"S_IWRITE=S_IWUSR",
"S_IEXEC=S_IXUSR",
],
"//conditions:default": [],
}),
includes = ["."],
visibility = ["//visibility:public"],
deps = select({
":windows": [":windows_polyfill"],
"//conditions:default": [],
}),
)
cc_library(
name = "windows_polyfill",
hdrs = ["windows/unistd.h"],
includes = ["windows"],
)
genrule(
name = "windows_unistd_h",
outs = ["windows/unistd.h"],
cmd = "touch $@",
)
config_setting(
name = "windows",
values = {
"cpu": "x64_windows",
},
)
config_setting(
name = "android",
values = {"crosstool_top": "//external:android/crosstool"},
)