Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315807 Details for
Bug 461074
libuser crashes on parsing invalid entries with missing semi-colons :
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Consistently use "" if the last field is not present
libuser-0.52.5-no-last-field.patch (text/plain), 2.31 KB, created by
Miloslav Trmač
on 2008-09-04 20:38:27 UTC
(
hide
)
Description:
Consistently use "" if the last field is not present
Filename:
MIME Type:
Creator:
Miloslav Trmač
Created:
2008-09-04 20:38:27 UTC
Size:
2.31 KB
patch
obsolete
>diff -ur libuser/modules/files.c libuser-0.52.5/modules/files.c >--- libuser/modules/files.c 2008-09-04 22:12:18.000000000 +0200 >+++ libuser-0.52.5/modules/files.c 2008-09-04 22:30:20.000000000 +0200 >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2000-2002, 2008 Red Hat, Inc. >+ * Copyright (C) 2000-2002, 2006, 2008 Red Hat, Inc. > * > * This is free software; you can redistribute it and/or modify it under > * the terms of the GNU Library General Public License as published by >@@ -341,7 +341,12 @@ > /* Now parse out the fields. */ > memset(&value, 0, sizeof(value)); > for (i = 0; i < format_count; i++) { >+ const gchar *val; >+ > field = formats[i].position - 1; >+ val = v[field]; >+ if (val == NULL) >+ val = ""; > /* Clear out old values in the destination structure. */ > lu_ent_clear_current(ent, formats[i].attribute); > if (formats[i].multiple) { >@@ -349,7 +354,7 @@ > gchar **w; > int j; > /* Split up the field. */ >- w = g_strsplit(v[field] ?: "", ",", 0); >+ w = g_strsplit(val, ",", 0); > /* Clear out old values. */ > for (j = 0; (w != NULL) && (w[j] != NULL); j++) { > /* Skip over empty strings. */ >@@ -378,7 +383,7 @@ > g_value_init(&value, formats[i].type); > /* Check if we need to supply the default value. */ > if ((formats[i].def != NULL) && >- (strlen(v[field]) == 0)) { >+ (strlen(val) == 0)) { > /* Convert the default to the right type. */ > if (G_VALUE_HOLDS_STRING(&value)) { > g_value_set_string(&value, >@@ -396,7 +401,7 @@ > } else { > /* Use the value itself. */ > if (G_VALUE_HOLDS_STRING(&value)) { >- g_value_set_string(&value, v[field]); >+ g_value_set_string(&value, val); > } else > if (G_VALUE_HOLDS_LONG(&value)) { > /* Make sure the field contains an >@@ -404,7 +409,7 @@ > * a loaded word) number. */ > char *p; > long l; >- l = strtol(v[field], &p, 0); >+ l = strtol(val, &p, 0); > g_assert(p != NULL); > if (*p != '\0') { > g_warning("entry is incorrectly formatted"); >@@ -2574,12 +2579,10 @@ > } > /* If the account name matches the pattern, parse it and add > * it to the list. */ >- if (fnmatch(pattern, buf, 0) == 0) { >- parser(buf, ent); >+ if (fnmatch(pattern, key, 0) == 0 && parser(buf, ent) != FALSE) > g_ptr_array_add(ret, ent); >- } else { >+ else > lu_ent_free(ent); >- } > g_free(buf); > g_free(key); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 461074
:
315712
| 315807