POSIX.1 National Language Support API for MinGW
Revisión | 4e24f181b37cb89cefefdbb658024e2977206333 (tree) |
---|---|
Tiempo | 2007-08-18 03:18:38 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Avoid a potential segmentation fault.
@@ -1,5 +1,12 @@ | ||
1 | 1 | 2007-08-17 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 2 | |
3 | + Avoid a potential segmentation fault. | |
4 | + | |
5 | + * mcmerge.c (mc_merge): Don't blindly inspect data fields within | |
6 | + the `curr' message record; `curr' may be NULL, so test it first. | |
7 | + | |
8 | +2007-08-17 Keith Marshall <keithmarshall@users.sourceforge.net> | |
9 | + | |
3 | 10 | * man/gencat.man (TH): Correct section; s/MAN3EXT/MAN1EXT/ |
4 | 11 | |
5 | 12 | 2007-08-16 Keith Marshall <keithmarshall@users.sourceforge.net> |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * any single source file into its current internal dictionary. |
11 | 11 | * |
12 | 12 | * Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
13 | - * Last modification: 12-May-2007 | |
13 | + * Last modification: 17-Aug-2007 | |
14 | 14 | * |
15 | 15 | * |
16 | 16 | * This is free software. It is provided AS IS, in the hope that it may |
@@ -146,7 +146,7 @@ struct msgdict *mc_merge( struct msgdict *cat, struct msgdict *input ) | ||
146 | 146 | dfprintf(( stderr, "Initialise message list at set %u message %u\n", mark->set, mark->msg )); |
147 | 147 | } |
148 | 148 | } |
149 | - else if( curr->key == input->key ) | |
149 | + else if( curr && (curr->key == input->key) ) | |
150 | 150 | { |
151 | 151 | /* The input record refers to a message which is already present |
152 | 152 | * in the current message list; the operation to be performed is |
@@ -221,7 +221,7 @@ struct msgdict *mc_merge( struct msgdict *cat, struct msgdict *input ) | ||
221 | 221 | mark = input; |
222 | 222 | } |
223 | 223 | } |
224 | - else | |
224 | + else if( curr ) | |
225 | 225 | { |
226 | 226 | /* There is no existing reference with set and message numbers |
227 | 227 | * matching the current input record; thus the input record must |
@@ -253,6 +253,16 @@ struct msgdict *mc_merge( struct msgdict *cat, struct msgdict *input ) | ||
253 | 253 | dfprintf(( stderr, "before set %u message %u\n", curr->set, curr->msg )); |
254 | 254 | input->link = curr; |
255 | 255 | } |
256 | +# ifdef DEBUG | |
257 | + else | |
258 | + { | |
259 | + /* There is no `curr' record and the input record has not been | |
260 | + * appended; this must be a delete request, with nothing to act on, | |
261 | + * so we simply ignore it. | |
262 | + */ | |
263 | + dfprintf(( stderr, "Ignore delete request for non-existent message\n" )); | |
264 | + } | |
265 | +# endif | |
256 | 266 | } |
257 | 267 | |
258 | 268 | else if( input->set && (input->base == NULL) ) |
@@ -366,4 +376,4 @@ struct msgdict *mc_merge( struct msgdict *cat, struct msgdict *input ) | ||
366 | 376 | return cat; |
367 | 377 | } |
368 | 378 | |
369 | -/* $RCSfile$Revision: 1.2 $: end of file */ | |
379 | +/* $RCSfile$Revision: 1.3 $: end of file */ |