mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
4779c8278f
Getting the value of the x variable on the file corresponding to the below ncdump output with -fsanitize=undefined raises ncx.c:1034:14: runtime error: left shift of 128 by 24 places cannot be represented in type 'int' This is due to *cp being promoted to int before doing the left shift, instead of the intended unsigned. So do the cast to unsigned internally rather than externally ncdump file to reproduce: netcdf temp { dimensions: x = 2 ; y = 2 ; v = 2 ; variables: int x(v) ; byte y(y, x) ; data: x = _, _ ; y = -127, -127, -127, -127 ; } Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2356 Credit to OSS Fuzz |
||
---|---|---|
.. | ||
attr.m4 | ||
CMakeLists.txt | ||
depend | ||
dim.c | ||
ffio.c | ||
lookup3.c | ||
Makefile.am | ||
memio.c | ||
mmapio.c | ||
nc3dispatch.c | ||
nc3internal.c | ||
nc_hashmap.c | ||
ncFile.c | ||
ncio.c | ||
ncio.h | ||
ncstdio.c | ||
ncstdio.h | ||
ncx_cray.c | ||
ncx.h | ||
ncx.m4 | ||
posixio.c | ||
pstdint.h | ||
putget.m4 | ||
t_ncio.c | ||
t_ncio.in | ||
t_ncxx.m4 | ||
test_nc.sav | ||
v1hpg.c | ||
var.c | ||
winceio.c | ||
XGetopt.c |