Merge "Fix 1684100: Making sure that empty package, type and resource ids are not accepted."
This commit is contained in:
committed by
Android (Google) Code Review
commit
93f588ce3a
@@ -2609,6 +2609,24 @@ bool ResTable::expandResourceRef(const uint16_t* refStr, size_t refLen,
|
||||
*outType = *defType;
|
||||
}
|
||||
*outName = String16(p, end-p);
|
||||
if(**outPackage == 0) {
|
||||
if(outErrorMsg) {
|
||||
*outErrorMsg = "Resource package cannot be an empty string";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(**outType == 0) {
|
||||
if(outErrorMsg) {
|
||||
*outErrorMsg = "Resource type cannot be an empty string";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(**outName == 0) {
|
||||
if(outErrorMsg) {
|
||||
*outErrorMsg = "Resource id cannot be an empty string";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user