projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uci: fix a potential use-after-free in uci_set()
[project/uci.git]
/
uci.h
diff --git
a/uci.h
b/uci.h
index
abba660
..
43f2052
100644
(file)
--- a/
uci.h
+++ b/
uci.h
@@
-252,6
+252,8
@@
extern int uci_list_configs(struct uci_context *ctx, char ***list);
* uci_set_savedir: override the default delta save directory
* @ctx: uci context
* @dir: directory name
* uci_set_savedir: override the default delta save directory
* @ctx: uci context
* @dir: directory name
+ *
+ * This will also try adding the specified dir to the end of delta pathes.
*/
extern int uci_set_savedir(struct uci_context *ctx, const char *dir);
*/
extern int uci_set_savedir(struct uci_context *ctx, const char *dir);
@@
-269,8
+271,8
@@
extern int uci_set_confdir(struct uci_context *ctx, const char *dir);
*
* This function allows you to add directories, which contain 'overlays'
* for the active config, that will never be committed.
*
* This function allows you to add directories, which contain 'overlays'
* for the active config, that will never be committed.
- *
Caller of this API should ensure that no duplicate entries (including the
- *
default search path, e.g. `UCI_SAVEDIR') should be add
ed.
+ *
+ *
Adding a duplicate directory will cause UCI_ERR_DUPLICATE be return
ed.
*/
extern int uci_add_delta_path(struct uci_context *ctx, const char *dir);
*/
extern int uci_add_delta_path(struct uci_context *ctx, const char *dir);
@@
-687,6
+689,15
@@
uci_lookup_option_string(struct uci_context *ctx, struct uci_section *s, const c
return o->v.string;
}
return o->v.string;
}
+#ifndef BITS_PER_LONG
+#define BITS_PER_LONG (8 * sizeof(unsigned long))
+#endif
+
+static inline void uci_bitfield_set(unsigned long *bits, int bit)
+{
+ bits[bit / BITS_PER_LONG] |= (1UL << (bit % BITS_PER_LONG));
+}
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif