Comments (2)
Hi Haili,
thanks for your suggestion. I really appreciate this.
But this is already fixed now with FORCE 3.5.2
.
I would however suggest you not using your proposed fix as this is insecure (have a read here), and actually fails in this case.
The problem here is, that I forgot to replace the EOL character in the reading funtion, i.e. tokenptr = "MOD\n"
, should actually be tokenptr = "MOD\0"
This means that the copied string won't be null-terminated, which might cause other problems.
The copy_string function already did as you suggest, but adds a test whether the string is null-terminated after copying. As we were copying 4 (tokenptr = "MOD\n
) instead of 3 characters (tokenptr = "MOD\0"
), there was no space for the terminating NULL, and the function fails safely:
void copy_string(char *dst, size_t size, const char *src){
strncpy(dst, src, size);
if (dst[size-1] != '\0'){
printf("cannot copy, string too long:\n%s\n", src);
exit(1);
}
return;
}
The fix is to include this line here in src/lower-level/gas-ll.c
in l. 682:
buffer[strcspn(buffer, "\r\n#")] = 0;
This even makes it safe to use a file with Windows EOL.
Cheers,
David
from force.
Thanks David,
I tested 3.5.2 and it works now. It wasn't really a fix I proposed, just I workaround so I could identify the source of error and continue processing. Good you have a solid fix now, thanks!
Cheers, Haili
from force.
Related Issues (20)
- force-mosaic only supports tif HOT 4
- Potential race condition in force-cube HOT 4
- Optional cirrus buffer HOT 1
- [Documentaton] Texture Metrics, Landscape Metrics, Sampling HOT 2
- Masked blocks in TSS are assigned 0 instead of nodata value HOT 7
- RTD is referencing an outdated revision HOT 5
- Projection problem when force-cubing Sentinel-1 images HOT 3
- Apparent data loss when selecting EQUI7-EU as output HOT 4
- MODIS to be decommissioned; is there an alternative? HOT 2
- 24h interaction cooldown for new GitHub users
- Error when downloading Landsat with force-level1-landsat search HOT 10
- Error when using force-level1-landsat search with --forcelogs HOT 2
- Changes in the authorization process for Google Cloud may affect force-level1-csd soon HOT 9
- Level2 - Couldn't open the directory: Input/output error HOT 4
- level-1-landsat-download: Some links seem to be broken HOT 8
- Example command in documentation failing
- Documentation on Read The Docs broken HOT 3
- Sentinel-2 Volume 11 and Volume 12: FORCE differences from sen2cor HOT 2
- [force-l2ps] High number of opened files by the force-l2ps process HOT 2
- force-cube fails when using gdal 3.8.4 because output is redirected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from force.