Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When receiving an empty string, aes_decrypt produces the following warning.
warning: mdecrypt_generic() [function.mdecrypt-generic]: An empty string was passed in .../sites/all/modules/contrib/aes/aes.module on line 762.
Using isset() instead of empty() on line 696 of aes.module fixes the issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | base64decodefirst-1218566-3.patch | 703 bytes | dan_lennox |
Comments
Comment #1
dan_lennox CreditAttribution: dan_lennox commentedPatch supplied.
Comment #2
dan_lennox CreditAttribution: dan_lennox commentedOK this is still an issue but my fix is completely wrong.
Comment #3
dan_lennox CreditAttribution: dan_lennox commentedActual issue was being caused by $string = base64_decode($string); being called after the test for "empty" instead of before. Patch supplied.
Comment #4
easyfit CreditAttribution: easyfit commentedI'll leave it to lee20 to apply the patch, but I just want to say nice catch and thanks for looking into this! It's been a standing issue for some time
Comment #5
dan_lennox CreditAttribution: dan_lennox commentedNo worries. Thanks for the handy module!
Comment #6
dan_lennox CreditAttribution: dan_lennox commentedWhoops forgot to change status.
Comment #7
EvanDonovan CreditAttribution: EvanDonovan commentedAre you sure this is the correct fix? Seems counter-intuitive not to check first.
Also, tracking for 7.x.
Comment #8
EvanDonovan CreditAttribution: EvanDonovan commentedComment #9
dpovshed CreditAttribution: dpovshed commentedIf someone interested in having this fixed - please do code review.
Comment #10
AshwinB CreditAttribution: AshwinB commentedAfter applying the patch, the warning still shows up, just with different text.. Now it says "Tried to decrypt an empty string.". After applying the patch, the warning gets logged multiple times during each login. Any suggestions?
Comment #11
dpovshed CreditAttribution: dpovshed commented@Amaster123, thank you for testing this!
Comment #13
dpovshed CreditAttribution: dpovshed commentedI checked patch in comment #3 and it worked fine to me to solve this minor problem.
Maybe I overlook somethhing and any of you have more sophisticated use-cases - feel free to report in details and reopen issue.
Patch was adopted and committed, thanks @dan_lennox !
Tested with code: