-
Notifications
You must be signed in to change notification settings - Fork 26
Maintainance cleanup #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e4a3ec
056b9c9
e40d4a3
ebf53e3
ab5f397
ceec5c2
e030217
2c22f54
1319660
5d2b6b3
1dcd750
b8b9657
ce1effc
89d9e06
8149495
9c7ccd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,11 @@ | |
| * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| #include <assert.h> | ||
| #include <stdio.h> | ||
| #include <string.h> | ||
| #include "attr.h" | ||
| #include "booth.h" | ||
| #include "ticket.h" | ||
| #include "pacemaker.h" | ||
|
|
||
|
|
@@ -244,7 +247,8 @@ static void free_geo_attr(gpointer data) | |
| g_free(a); | ||
| } | ||
|
|
||
| int store_geo_attr(struct ticket_config *tk, const char *name, char *val, int notime) | ||
| int store_geo_attr(struct ticket_config *tk, const char *name, | ||
| const char *val, int notime) | ||
| { | ||
| struct geo_attr *a; | ||
| GDestroyNotify free_geo_attr_notify = free_geo_attr; | ||
|
|
@@ -274,8 +278,9 @@ int store_geo_attr(struct ticket_config *tk, const char *name, char *val, int no | |
| if (!notime) | ||
| get_time(&a->update_ts); | ||
|
|
||
| assert(strnlen(name, BOOTH_NAME_LEN) < BOOTH_NAME_LEN); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather have booth continue to run, even with a truncated attribute name. iirc, this was not unpremeditated.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I understand that it might be too easy (accidentally or not) to push booth layer out of the function with a single crafted geo attribute in CIB/crm_ticket one-liner. So does turning that into warning sounds better? Then, we should likely warn also in case of trying to set/delete such a troublesome (too long in either name or value) attribute being provided by the user to geostore command. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Tue, Apr 19, 2016 at 06:26:49AM -0700, Jan Pokorný wrote:
Yes, warning seems to be better. |
||
| g_hash_table_insert(tk->attr, | ||
| g_strndup(name, BOOTH_NAME_LEN), a); | ||
| g_strndup(name, BOOTH_NAME_LEN-1), a); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be %endif, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 18/04/16 08:21 -0700, Dejan Muhamedagic wrote:
Right, thanks for noticing.
(I blame vim highlighter for showing "%if" the same way as "%fi").
Jan (Poki)