[Rpm-maint] [rpm-software-management/rpm] Enhance requires with version information from the build root. (PR #2372)
Panu Matilainen
notifications at github.com
Mon Feb 6 13:02:57 UTC 2023
@pmatilai commented on this pull request.
> + cpid = fork();
+ if (cpid == -1) {
+ return NULL; // Should this be a fatal error instead?
+ }
+ if (cpid == 0) {
+ void *dl_handle;
+ struct link_map *linkmap;
+ char *version = NULL;
+
+ close(pipefd[0]);
+ dl_handle = dlmopen(LM_ID_NEWLM, filename, RTLD_LAZY);
+ if (dl_handle == NULL) _exit(0);
+ if (dlinfo(dl_handle, RTLD_DI_LINKMAP, &linkmap) != -1) {
+ version = getLibtoolVer(linkmap->l_name);
+ }
+ (void) write(pipefd[1], version, strlen(version));
There's a segfault here: if either dlinfo() or getLibtoolVer() fails, strlen() will get called with NULL from the version.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2372#pullrequestreview-1285149612
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2372/review/1285149612 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230206/42fffdab/attachment.html>
More information about the Rpm-maint
mailing list