Check error returns from strupper_m() (in all reasonable places).
[nivanova/samba-autobuild/.git] / source3 / utils / net_registry_check.c
index 872aa5a371003615952bccafc579c1700b1b5d08..45a01f20f5e5ea96ff660cc6e434f8068dc5e43e 100644 (file)
@@ -419,7 +419,10 @@ static bool read_info(struct check_ctx *ctx, const char *key, TDB_DATA val)
 static bool is_all_upper(const char *str) {
        bool ret;
        char *tmp = talloc_strdup(talloc_tos(), str);
-       strupper_m(tmp);
+       if (!strupper_m(tmp)) {
+               talloc_free(tmp);
+               return false;
+       }
        ret = (strcmp(tmp, str) == 0);
        talloc_free(tmp);
        return ret;
@@ -698,7 +701,10 @@ static bool normalize_path_internal(char* path, char sep) {
        }
        *optr = '\0';
 
-       strupper_m(path);
+       if (!strupper_m(path)) {
+               talloc_free(discard_const(orig));
+               return false;
+       }
        changed = (strcmp(orig, path) != 0);
        talloc_free(discard_const(orig));
        return changed;