Move idnkit from SFW to oi-userland
[unleashed-userland.git] / components / library / idnkit / patches / lib_mapper.c.patch
blob881949f2b1c9d347edd1370e0c8e3762e91903de
1 *** idnkit-1.0-src/lib/mapper.c.org Wed Aug 27 11:37:02 2003
2 --- idnkit-1.0-src/lib/mapper.c Tue Sep 2 15:57:01 2003
3 ***************
4 *** 156,161 ****
5 --- 156,165 ----
7 assert(scheme_hash != NULL);
8 assert(ctxp != NULL);
9 + #ifdef SUN_CHANGE
10 + if (scheme_hash == NULL || ctxp == NULL)
11 + return (idn_nomemory);
12 + #endif /* SUN_CHANGE */
14 TRACE(("idn_mapper_create()\n"));
16 ***************
17 *** 194,199 ****
18 --- 198,207 ----
20 assert(scheme_hash != NULL);
21 assert(ctx != NULL);
22 + #ifdef SUN_CHANGE
23 + if (scheme_hash == NULL || ctx == NULL)
24 + return;
25 + #endif /* SUN_CHANGE */
27 TRACE(("idn_mapper_destroy()\n"));
29 ***************
30 *** 214,219 ****
31 --- 222,231 ----
32 void
33 idn_mapper_incrref(idn_mapper_t ctx) {
34 assert(ctx != NULL && scheme_hash != NULL);
35 + #ifdef SUN_CHANGE
36 + if (scheme_hash == NULL || ctx == NULL)
37 + return;
38 + #endif /* SUN_CHANGE */
40 TRACE(("idn_mapper_incrref()\n"));
41 TRACE(("idn_mapper_incrref: update reference count (%d->%d)\n",
42 ***************
43 *** 234,239 ****
44 --- 246,255 ----
46 assert(scheme_hash != NULL);
47 assert(ctx != NULL);
48 + #ifdef SUN_CHANGE
49 + if (scheme_hash == NULL || ctx == NULL)
50 + return (idn_invalid_name);
51 + #endif /* SUN_CHANGE */
53 TRACE(("idn_mapper_add(scheme_name=%s)\n",
54 idn__debug_xstring(scheme_name, 50)));
55 ***************
56 *** 282,287 ****
57 --- 298,307 ----
58 * Add the scheme.
60 assert(ctx->nschemes <= ctx->scheme_size);
61 + #ifdef SUN_CHANGE
62 + if (ctx->nschemes > ctx->scheme_size)
63 + return (idn_invalid_name);
64 + #endif /* SUN_CHANGE */
66 if (ctx->nschemes == ctx->scheme_size) {
67 map_scheme_t *new_schemes;
68 ***************
69 *** 320,325 ****
70 --- 340,349 ----
72 assert(scheme_hash != NULL);
73 assert(ctx != NULL && scheme_names != NULL);
74 + #ifdef SUN_CHANGE
75 + if (ctx == NULL || scheme_hash == NULL || scheme_names == NULL)
76 + return (idn_invalid_name);
77 + #endif /* SUN_CHANGE */
79 TRACE(("idn_mapper_addall(nschemes=%d)\n", nschemes));
81 ***************
82 *** 349,354 ****
83 --- 373,382 ----
85 assert(scheme_hash != NULL);
86 assert(ctx != NULL && from != NULL && to != NULL);
87 + #ifdef SUN_CHANGE
88 + if (ctx == NULL || scheme_hash == NULL || from == NULL || to == NULL)
89 + return (idn_buffer_overflow);
90 + #endif /* SUN_CHANGE */
92 TRACE(("idn_mapper_map(from=\"%s\", tolen=%d)\n",
93 idn__debug_ucs4xstring(from, 50), (int)tolen));
94 ***************
95 *** 444,449 ****
96 --- 472,482 ----
97 assert(scheme_hash != NULL);
98 assert(prefix != NULL && create != NULL && destroy != NULL &&
99 map != NULL);
100 + #ifdef SUN_CHANGE
101 + if (prefix == NULL || scheme_hash == NULL || create == NULL ||
102 + destroy == NULL || map == NULL)
103 + return (idn_nomemory);
104 + #endif /* SUN_CHANGE */
106 TRACE(("idn_mapper_register(prefix=%s)\n", prefix));