auc: only add filesystem type if it is known
authorDaniel Golle <daniel@makrotopia.org>
Mon, 21 Mar 2022 11:50:26 +0000 (11:50 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 24 Mar 2022 23:05:47 +0000 (23:05 +0000)
Prevent NULL-pointer on older versions of OpenWrt.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f1969ab5849095dbfe85f34e9415988357ed53bf)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
utils/auc/src/auc.c

index 4d4b6917d30a4b90e6e0e09120cb053b53691536..f3468a5a8d59693ac6381eda5ddda3fead75a388 100644 (file)
@@ -1647,7 +1647,9 @@ int main(int args, char *argv[]) {
        blobmsg_add_string(&reqbuf, "version", branch->version);
        blobmsg_add_string(&reqbuf, "version_code", branch->version_code);
        blobmsg_add_string(&reqbuf, "target", target);
-       blobmsg_add_string(&reqbuf, "filesystem", target_fstype?target_fstype:rootfs_type);
+
+       if (target_fstype || rootfs_type)
+               blobmsg_add_string(&reqbuf, "filesystem", target_fstype?target_fstype:rootfs_type);
 
        sanetized_board_name = strdup(board_name);
        tmp = sanetized_board_name;