diff options
author | Thomas White <taw@physics.org> | 2021-06-21 16:12:00 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-06-21 16:12:00 +0200 |
commit | 191e011a5f815d0b813e8fb9dabd7cb6943a8fff (patch) | |
tree | 412ff216b8db0ba45d337498ba9e05db849c06ac /libcrystfel | |
parent | 1d081d4c927cff1502d4d3faf9b00485726eef64 (diff) |
image_cache_header_str: Reject strings containing newlines
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/image.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index f25f70d2..a71c0b97 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -343,6 +343,11 @@ void image_cache_header_str(struct image *image, const char *header_name, const char *header_val) { + if ( strchr(header_val, '\n') != NULL ) { + ERROR("Header '%s' contains newline (not allowed!)\n"); + return; + } + if ( image->n_cached_headers >= HEADER_CACHE_SIZE ) { ERROR("Too many headers to copy.\n"); } else { |