Fix memory leak in arg parsing (switched from malloc to apr_strndup)
Cleaned up warnings
Refactored dims_get_image_data to avoid passing so many parameters
Things still needing work:
The watermark is skewed, not sure if this was intentional.
The cached watermark image should be saved to hashed directory path that only www-data can write too.
I think the encryption code has a memory leak (unable to test that functionality but b64 variable in base_64_decode is never freed)
The use of abort() in the decrypt logic seems aggressive! Maybe that method should return a status code that you can check. abort() will kill the Apache process.
aes_128_decrypt uses a fixed buffer of 128 chars. I think this will break when using longer image urls.
Please pull in the fixes from https://github.com/beetlebugorg/mod_dims/tree/rohitmonga-feature/watermark:
Things still needing work:
b64
variable in base_64_decode is never freed)abort()
in the decrypt logic seems aggressive! Maybe that method should return a status code that you can check.abort()
will kill the Apache process.aes_128_decrypt
uses a fixed buffer of 128 chars. I think this will break when using longer image urls.