test and fix: adding an empty user id should fail

This commit is contained in:
Vincent Breitmoser
2014-07-26 03:47:29 +02:00
parent f560bc9317
commit ab2b90342e
4 changed files with 20 additions and 1 deletions

View File

@@ -313,6 +313,11 @@ public class PgpKeyOperation {
for (String userId : saveParcel.mAddUserIds) {
log.add(LogLevel.INFO, LogType.MSG_MF_UID_ADD, indent);
if (userId.equals("")) {
log.add(LogLevel.ERROR, LogType.MSG_MF_UID_ERROR_EMPTY, indent+1);
return null;
}
// this operation supersedes all previous binding and revocation certificates,
// so remove those to retain assertions from canonicalization for later operations
@SuppressWarnings("unchecked")