Hi, On Montag, 28. Juni 2021 21:37:58 CEST Schultschik, Sven via Gnupg-users wrote: > Hello all together, > > I have created a small Applikation to zip and encrypte and vise versa. > > I struggle at the point of err = gpgme_op_decrypt(ctx, in, out); > Which terminates with an segfault if not sufficient access rights are > available. If I run with sudo it works as expected.
It would be really helpful if you'd give us the backtrace you get for the segfault. Moreover, it is unclear what you mean by "not sufficient access rights are available". Is the input file only readable by root? Or is only root allowed to write to fullBackupPath? Quite frankly, it's up to you, the caller/user of gpgme, to check whether the fopen() calls succeeded before you pass the streams to gpgme. You do check instream for being NULL, but apparently you forgot to check outstream. Should gpgme_data_new_from_stream() check for a null pointer passed to it? Maybe. Should you pass a NULL pointer to gpgme_data_new_from_stream()? Definitely not. It makes no sense because how should gpgme_data_new_from_stream() know the reason for the NULL pointer? FWIW, I just checked. gpgme_data_new_from_stream() does not check for a NULL pointer. I guess this could be changed. Regards, Ingo
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Gnupg-users mailing list [email protected] http://lists.gnupg.org/mailman/listinfo/gnupg-users
