mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
17 lines
367 B
Diff
17 lines
367 B
Diff
|
--- a/libopkg/parse_util.c
|
||
|
+++ b/libopkg/parse_util.c
|
||
|
@@ -35,7 +35,12 @@ is_field(const char *type, const char *l
|
||
|
char *
|
||
|
parse_simple(const char *type, const char *line)
|
||
|
{
|
||
|
- return trim_xstrdup(line + strlen(type) + 1);
|
||
|
+ char *field = trim_xstrdup(line + strlen(type) + 1);
|
||
|
+ if (strlen(field) == 0) {
|
||
|
+ free(field);
|
||
|
+ return NULL;
|
||
|
+ }
|
||
|
+ return field;
|
||
|
}
|
||
|
|
||
|
/*
|