* small buffer overflow in ecryptfs_new_file_context()
@ 2015-01-31 13:23 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-01-31 13:23 UTC (permalink / raw)
To: mhalcrow; +Cc: ecryptfs
Hello Michael Halcrow,
The patch 237fead61998: "[PATCH] ecryptfs: fs/Makefile and
fs/Kconfig" from Oct 4, 2006, leads to the following static checker
warning:
fs/ecryptfs/crypto.c:846 ecryptfs_new_file_context()
error: off-by-one overflow 'crypt_stat->cipher' size 32. rl = '0-32'
fs/ecryptfs/crypto.c
841 cipher_name_len =
842 strlen(mount_crypt_stat->global_default_cipher_name);
843 memcpy(crypt_stat->cipher,
844 mount_crypt_stat->global_default_cipher_name,
845 cipher_name_len);
846 crypt_stat->cipher[cipher_name_len] = '\0';
We're basically doing a complicated:
strcpy(crypt_stat->cipher,
mount_crypt_stat->global_default_cipher_name);
But ->global_default_cipher_name has one more character than ->cipher so
it doesn't necessarily fit.
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-01-31 13:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31 13:23 small buffer overflow in ecryptfs_new_file_context() Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.