1 Oracle patch to handle invalid inputs
2 Sent upstream via e-mail
3 diff --git a/lib/api.c b/lib/api.c
7 char actions_string[ACTION_STRING_BUFSIE];
9 assert(from != NULL && to != NULL);
11 + if (from == NULL || to == NULL)
12 + return (idn_invalid_name);
13 +#endif /* SUN_CHANGE */
15 idn__res_actionstostring(actions, actions_string);
16 TRACE(("idn_encodename(actions=%s, from=\"%s\", tolen=%d)\n",
18 char actions_string[ACTION_STRING_BUFSIE];
20 assert(from != NULL && to != NULL);
22 + if (from == NULL || to == NULL)
23 + return (idn_invalid_name);
24 +#endif /* SUN_CHANGE */
26 idn__res_actionstostring(actions, actions_string);
27 TRACE(("idn_decodename(actions=%s, from=\"%s\", tolen=%d)\n",
29 char actions_string[ACTION_STRING_BUFSIE];
31 assert(from != NULL && to != NULL);
33 + if (from == NULL || to == NULL)
34 + return (idn_invalid_name);
35 +#endif /* SUN_CHANGE */
37 idn__res_actionstostring(actions, actions_string);
38 TRACE(("idn_decodename2(actions=%s, from=\"%s\", tolen=%d, "
40 char actions2_string[ACTION_STRING_BUFSIE];
42 assert(name1 != NULL && name2 != NULL);
44 + if (name1 == NULL || name2 == NULL)
45 + return (idn_invalid_name);
46 +#endif /* SUN_CHANGE */
48 idn__res_actionstostring(actions1, actions1_string);
49 idn__res_actionstostring(actions2, actions2_string);
51 char actions_string[ACTION_STRING_BUFSIE];
56 + return (idn_invalid_name);
57 +#endif /* SUN_CHANGE */
59 idn__res_actionstostring(actions, actions_string);
60 TRACE(("idn_checkname(actions=%s, name=\"%s\")\n",