Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153573425
D23109.id66576.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23109.id66576.diff
View Options
Index: head/lib/libc/locale/collate.c
===================================================================
--- head/lib/libc/locale/collate.c
+++ head/lib/libc/locale/collate.c
@@ -109,7 +109,7 @@
return (__collate_load_tables_l(encoding, &__xlocale_global_collate));
}
-int
+static int
__collate_load_tables_l(const char *encoding, struct xlocale_collate *table)
{
int i, chains, z;
@@ -147,7 +147,7 @@
}
map = mmap(NULL, sbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
(void) _close(fd);
- if ((TMP = map) == NULL) {
+ if ((TMP = map) == MAP_FAILED) {
return (_LDP_ERROR);
}
@@ -181,6 +181,11 @@
return (_LDP_ERROR);
}
+ if (table->map && (table->maplen > 0)) {
+ (void) munmap(table->map, table->maplen);
+ }
+ table->map = map;
+ table->maplen = sbuf.st_size;
table->info = info;
table->char_pri_table = (void *)TMP;
TMP += sizeof (collate_char_t) * (UCHAR_MAX + 1);
Index: head/lib/libc/locale/rune.c
===================================================================
--- head/lib/libc/locale/rune.c
+++ head/lib/libc/locale/rune.c
@@ -94,7 +94,7 @@
fdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
(void) _close(fd);
- if (fdata == NULL) {
+ if (fdata == MAP_FAILED) {
errno = EINVAL;
return (NULL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 12:58 AM (5 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32005484
Default Alt Text
D23109.id66576.diff (1 KB)
Attached To
Mode
D23109: libc: Fix a few bugs in the xlocale collation code.
Attached
Detach File
Event Timeline
Log In to Comment